Commit 9a42f8fa authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

compile on windows addresses #1253

git-svn-id: file:///svn/toku/tokudb.1032b@7847 c7de825b-a66e-492c-adef-691d508d4ae1
parent 4f3e9055
...@@ -82,7 +82,7 @@ setup (void) { ...@@ -82,7 +82,7 @@ setup (void) {
DB_TXN *txn; DB_TXN *txn;
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); CKERR(r); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_env_create(&env, 0); CKERR(r); r=db_env_create(&env, 0); CKERR(r);
r=env->set_lk_max_locks(env, N); CKERR(r); r=env->set_lk_max_locks(env, N); CKERR(r);
...@@ -90,11 +90,11 @@ setup (void) { ...@@ -90,11 +90,11 @@ setup (void) {
r=env->set_lk_max_objects(env, N); CKERR(r); r=env->set_lk_max_objects(env, N); CKERR(r);
#endif #endif
env->set_errfile(env, stderr); env->set_errfile(env, stderr);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=env->txn_begin(env, 0, &txn, 0); assert(r==0); r=env->txn_begin(env, 0, &txn, 0); assert(r==0);
r=db->open(db, txn, "foo.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=db->open(db, txn, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=txn->commit(txn, 0); assert(r==0); r=txn->commit(txn, 0); assert(r==0);
} }
......
...@@ -82,7 +82,7 @@ setup (void) { ...@@ -82,7 +82,7 @@ setup (void) {
DB_TXN *txn; DB_TXN *txn;
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); CKERR(r); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_env_create(&env, 0); CKERR(r); r=db_env_create(&env, 0); CKERR(r);
r=env->set_lk_max_locks(env, N); CKERR(r); r=env->set_lk_max_locks(env, N); CKERR(r);
...@@ -90,11 +90,11 @@ setup (void) { ...@@ -90,11 +90,11 @@ setup (void) {
r=env->set_lk_max_objects(env, N); CKERR(r); r=env->set_lk_max_objects(env, N); CKERR(r);
#endif #endif
env->set_errfile(env, stderr); env->set_errfile(env, stderr);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=env->txn_begin(env, 0, &txn, 0); assert(r==0); r=env->txn_begin(env, 0, &txn, 0); assert(r==0);
r=db->open(db, txn, "foo.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=db->open(db, txn, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=txn->commit(txn, 0); assert(r==0); r=txn->commit(txn, 0); assert(r==0);
} }
......
...@@ -77,7 +77,7 @@ setup (void) { ...@@ -77,7 +77,7 @@ setup (void) {
DB_TXN *txn; DB_TXN *txn;
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); CKERR(r); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_env_create(&env, 0); CKERR(r); r=db_env_create(&env, 0); CKERR(r);
r=env->set_lk_max_locks(env, N); CKERR(r); r=env->set_lk_max_locks(env, N); CKERR(r);
...@@ -85,12 +85,12 @@ setup (void) { ...@@ -85,12 +85,12 @@ setup (void) {
r=env->set_lk_max_objects(env, N); CKERR(r); r=env->set_lk_max_objects(env, N); CKERR(r);
#endif #endif
env->set_errfile(env, stderr); env->set_errfile(env, stderr);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=db->set_flags(db, DB_DUPSORT); r=db->set_flags(db, DB_DUPSORT);
r=env->txn_begin(env, 0, &txn, 0); assert(r==0); r=env->txn_begin(env, 0, &txn, 0); assert(r==0);
r=db->open(db, txn, "foo.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=db->open(db, txn, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=txn->commit(txn, 0); assert(r==0); r=txn->commit(txn, 0); assert(r==0);
} }
......
...@@ -77,7 +77,7 @@ setup (void) { ...@@ -77,7 +77,7 @@ setup (void) {
DB_TXN *txn; DB_TXN *txn;
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); CKERR(r); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_env_create(&env, 0); CKERR(r); r=db_env_create(&env, 0); CKERR(r);
r=env->set_lk_max_locks(env, N); CKERR(r); r=env->set_lk_max_locks(env, N); CKERR(r);
...@@ -85,12 +85,12 @@ setup (void) { ...@@ -85,12 +85,12 @@ setup (void) {
r=env->set_lk_max_objects(env, N); CKERR(r); r=env->set_lk_max_objects(env, N); CKERR(r);
#endif #endif
env->set_errfile(env, stderr); env->set_errfile(env, stderr);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=db->set_flags(db, DB_DUPSORT); r=db->set_flags(db, DB_DUPSORT);
r=env->txn_begin(env, 0, &txn, 0); assert(r==0); r=env->txn_begin(env, 0, &txn, 0); assert(r==0);
r=db->open(db, txn, "foo.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=db->open(db, txn, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=txn->commit(txn, 0); assert(r==0); r=txn->commit(txn, 0); assert(r==0);
} }
......
...@@ -9,17 +9,17 @@ do_627 (void) { ...@@ -9,17 +9,17 @@ do_627 (void) {
DB_ENV *env; DB_ENV *env;
DB *db; DB *db;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r=db_env_create(&env, 0); assert(r==0); r=db_env_create(&env, 0); assert(r==0);
env->set_errfile(env, stderr); env->set_errfile(env, stderr);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
DB_TXN *t1, *t2; DB_TXN *t1, *t2;
DBT a,b; DBT a,b;
r=env->txn_begin(env, 0, &t1, 0); assert(r==0); r=env->txn_begin(env, 0, &t1, 0); assert(r==0);
r=db->open(db, t1, "foo.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=db->open(db, t1, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db->put(db, t1, dbt_init(&a, "a", 2), dbt_init(&b, "b", 2), 0); r=db->put(db, t1, dbt_init(&a, "a", 2), dbt_init(&b, "b", 2), 0);
r=t1->commit(t1, 0); assert(r==0); r=t1->commit(t1, 0); assert(r==0);
......
...@@ -13,7 +13,7 @@ static void ...@@ -13,7 +13,7 @@ static void
setup (void) { setup (void) {
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
int r; int r;
r=mkdir(ENVDIR, 0777); CKERR(r); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_env_create(&env, 0); CKERR(r); r=db_env_create(&env, 0); CKERR(r);
env->set_errfile(env, stderr); env->set_errfile(env, stderr);
...@@ -21,13 +21,13 @@ setup (void) { ...@@ -21,13 +21,13 @@ setup (void) {
r=env->set_lk_max_objects(env, 2*num_insert); CKERR(r); r=env->set_lk_max_objects(env, 2*num_insert); CKERR(r);
#endif #endif
r=env->set_lk_max_locks(env, 2*num_insert); CKERR(r); r=env->set_lk_max_locks(env, 2*num_insert); CKERR(r);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=env->txn_begin(env, 0, &txn, 0); assert(r==0); r=env->txn_begin(env, 0, &txn, 0); assert(r==0);
r=db->set_bt_compare(db, int_dbt_cmp); CKERR(r); r=db->set_bt_compare(db, int_dbt_cmp); CKERR(r);
r=db->set_dup_compare(db, int_dbt_cmp); CKERR(r); r=db->set_dup_compare(db, int_dbt_cmp); CKERR(r);
r=db->open(db, txn, "foo.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=db->open(db, txn, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=txn->commit(txn, 0); assert(r==0); r=txn->commit(txn, 0); assert(r==0);
} }
......
...@@ -11,15 +11,15 @@ static void ...@@ -11,15 +11,15 @@ static void
test_setup (void) { test_setup (void) {
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
int r; int r;
r=mkdir(ENVDIR, 0777); CKERR(r); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_env_create(&env, 0); CKERR(r); r=db_env_create(&env, 0); CKERR(r);
env->set_errfile(env, stderr); env->set_errfile(env, stderr);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=env->txn_begin(env, 0, &txn, 0); assert(r==0); r=env->txn_begin(env, 0, &txn, 0); assert(r==0);
r=db->open(db, txn, "foo.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=db->open(db, txn, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=txn->commit(txn, 0); assert(r==0); r=txn->commit(txn, 0); assert(r==0);
} }
......
...@@ -17,17 +17,17 @@ static void test (void) { ...@@ -17,17 +17,17 @@ static void test (void) {
u_int64_t ilimit=100; u_int64_t ilimit=100;
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); CKERR(r); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_env_create(&env, 0); CKERR(r); r=db_env_create(&env, 0); CKERR(r);
// set the cachetable to size 1 so that things won't fit. // set the cachetable to size 1 so that things won't fit.
r=env->set_cachesize(env, 0, 1, 1); r=env->set_cachesize(env, 0, 1, 1);
env->set_errfile(env, stderr); env->set_errfile(env, stderr);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=db->set_flags(db, DB_DUP|DB_DUPSORT); assert(r==0); r=db->set_flags(db, DB_DUP|DB_DUPSORT); assert(r==0);
r=db->set_pagesize(db, 4096); r=db->set_pagesize(db, 4096);
r=env->txn_begin(env, 0, &txn, 0); assert(r==0); r=env->txn_begin(env, 0, &txn, 0); assert(r==0);
r=db->open(db, txn, "foo.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=db->open(db, txn, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=txn->commit(txn, 0); assert(r==0); r=txn->commit(txn, 0); assert(r==0);
r=env->txn_begin(env, 0, &txn, 0); assert(r==0); r=env->txn_begin(env, 0, &txn, 0); assert(r==0);
......
...@@ -17,17 +17,17 @@ static void test (void) { ...@@ -17,17 +17,17 @@ static void test (void) {
u_int64_t ilimit=10; u_int64_t ilimit=10;
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); CKERR(r); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_env_create(&env, 0); CKERR(r); r=db_env_create(&env, 0); CKERR(r);
// set the cachetable to size 1 so that things won't fit. // set the cachetable to size 1 so that things won't fit.
r=env->set_cachesize(env, 0, 1, 1); r=env->set_cachesize(env, 0, 1, 1);
env->set_errfile(env, stderr); env->set_errfile(env, stderr);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=db->set_flags(db, DB_DUP|DB_DUPSORT); assert(r==0); r=db->set_flags(db, DB_DUP|DB_DUPSORT); assert(r==0);
r=db->set_pagesize(db, 4096); r=db->set_pagesize(db, 4096);
r=env->txn_begin(env, 0, &txn, 0); assert(r==0); r=env->txn_begin(env, 0, &txn, 0); assert(r==0);
r=db->open(db, txn, "foo.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=db->open(db, txn, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=txn->commit(txn, 0); assert(r==0); r=txn->commit(txn, 0); assert(r==0);
r=env->txn_begin(env, 0, &txn, 0); assert(r==0); r=env->txn_begin(env, 0, &txn, 0); assert(r==0);
......
...@@ -18,16 +18,16 @@ static void test (void) { ...@@ -18,16 +18,16 @@ static void test (void) {
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); CKERR(r); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_env_create(&env, 0); CKERR(r); r=db_env_create(&env, 0); CKERR(r);
// set the cachetable to size 1 so that things won't fit. // set the cachetable to size 1 so that things won't fit.
r=env->set_cachesize(env, 0, 1, 1); r=env->set_cachesize(env, 0, 1, 1);
env->set_errfile(env, stderr); env->set_errfile(env, stderr);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=db->set_pagesize(db, 4096); r=db->set_pagesize(db, 4096);
r=env->txn_begin(env, 0, &txn, 0); assert(r==0); r=env->txn_begin(env, 0, &txn, 0); assert(r==0);
r=db->open(db, txn, "foo.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=db->open(db, txn, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=txn->commit(txn, 0); assert(r==0); r=txn->commit(txn, 0); assert(r==0);
u_int64_t i; u_int64_t i;
......
...@@ -17,14 +17,14 @@ static void test (void) { ...@@ -17,14 +17,14 @@ static void test (void) {
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); CKERR(r); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_env_create(&env, 0); CKERR(r); r=db_env_create(&env, 0); CKERR(r);
env->set_errfile(env, stderr); env->set_errfile(env, stderr);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=db->set_pagesize(db, 4096); r=db->set_pagesize(db, 4096);
r=env->txn_begin(env, 0, &txn, 0); assert(r==0); r=env->txn_begin(env, 0, &txn, 0); assert(r==0);
r=db->open(db, txn, "foo.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=db->open(db, txn, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=txn->commit(txn, 0); assert(r==0); r=txn->commit(txn, 0); assert(r==0);
u_int64_t i; u_int64_t i;
......
...@@ -16,11 +16,11 @@ static void ...@@ -16,11 +16,11 @@ static void
test_setup (void) { test_setup (void) {
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
int r; int r;
r=mkdir(ENVDIR, 0777); CKERR(r); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_env_create(&env, 0); CKERR(r); r=db_env_create(&env, 0); CKERR(r);
env->set_errfile(env, stderr); env->set_errfile(env, stderr);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=env->txn_begin(env, 0, &txn, 0); assert(r==0); r=env->txn_begin(env, 0, &txn, 0); assert(r==0);
...@@ -31,7 +31,7 @@ test_setup (void) { ...@@ -31,7 +31,7 @@ test_setup (void) {
snprintf(fname, sizeof(fname), "foo%d.db", i); snprintf(fname, sizeof(fname), "foo%d.db", i);
r=db_create(&dbs[i], env, 0); CKERR(r); r=db_create(&dbs[i], env, 0); CKERR(r);
r = dbs[i]->set_pagesize(dbs[i], 4096); r = dbs[i]->set_pagesize(dbs[i], 4096);
r=dbs[i]->open(dbs[i], txn, fname, 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=dbs[i]->open(dbs[i], txn, fname, 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
} }
r=txn->commit(txn, 0); assert(r==0); r=txn->commit(txn, 0); assert(r==0);
} }
......
...@@ -86,7 +86,7 @@ test_setup (void) { ...@@ -86,7 +86,7 @@ test_setup (void) {
DB_TXN *txn; DB_TXN *txn;
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); CKERR(r); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_env_create(&env, 0); CKERR(r); r=db_env_create(&env, 0); CKERR(r);
r=env->set_lk_max_locks(env, N); CKERR(r); r=env->set_lk_max_locks(env, N); CKERR(r);
...@@ -94,12 +94,12 @@ test_setup (void) { ...@@ -94,12 +94,12 @@ test_setup (void) {
r=env->set_lk_max_objects(env, N); CKERR(r); r=env->set_lk_max_objects(env, N); CKERR(r);
#endif #endif
env->set_errfile(env, stderr); env->set_errfile(env, stderr);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=db->set_flags(db, DB_DUPSORT); r=db->set_flags(db, DB_DUPSORT);
r=env->txn_begin(env, 0, &txn, 0); assert(r==0); r=env->txn_begin(env, 0, &txn, 0); assert(r==0);
r=db->open(db, txn, "foo.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=db->open(db, txn, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=txn->commit(txn, 0); assert(r==0); r=txn->commit(txn, 0); assert(r==0);
} }
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
static void test (void) { static void test (void) {
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
DB_ENV *env; DB_ENV *env;
DB_TXN *tid; DB_TXN *tid;
...@@ -20,11 +20,11 @@ static void test (void) { ...@@ -20,11 +20,11 @@ static void test (void) {
r=db_env_create(&env, 0); assert(r==0); r=db_env_create(&env, 0); assert(r==0);
env->set_errfile(env, stderr); env->set_errfile(env, stderr);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE|DB_THREAD, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE|DB_THREAD, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=env->txn_begin(env, 0, &tid, 0); assert(r==0); r=env->txn_begin(env, 0, &tid, 0); assert(r==0);
r=db->open(db, tid, "foo.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=db->open(db, tid, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=tid->commit(tid, 0); assert(r==0); r=tid->commit(tid, 0); assert(r==0);
r=env->txn_begin(env, 0, &tid, 0); assert(r==0); r=env->txn_begin(env, 0, &tid, 0); assert(r==0);
...@@ -38,10 +38,10 @@ static void test (void) { ...@@ -38,10 +38,10 @@ static void test (void) {
r=db_env_create(&env, 0); assert(r==0); r=db_env_create(&env, 0); assert(r==0);
env->set_errfile(env, stderr); env->set_errfile(env, stderr);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE|DB_THREAD|DB_RECOVER, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE|DB_THREAD|DB_RECOVER, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=env->txn_begin(env, 0, &tid, 0); assert(r==0); r=env->txn_begin(env, 0, &tid, 0); assert(r==0);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=db->open(db, tid, "foo.db", 0, DB_BTREE, 0, 0777); CKERR(r); r=db->open(db, tid, "foo.db", 0, DB_BTREE, 0, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db->get(db, tid, dbt_init(&key, "a", 2), dbt_init_malloc(&data), 0); assert(r==0); r=db->get(db, tid, dbt_init(&key, "a", 2), dbt_init_malloc(&data), 0); assert(r==0);
r=tid->commit(tid, 0); assert(r==0); r=tid->commit(tid, 0); assert(r==0);
free(data.data); free(data.data);
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
static void test (void) { static void test (void) {
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
DB_ENV *env; DB_ENV *env;
DB_TXN *tid; DB_TXN *tid;
...@@ -20,11 +20,11 @@ static void test (void) { ...@@ -20,11 +20,11 @@ static void test (void) {
r=db_env_create(&env, 0); assert(r==0); r=db_env_create(&env, 0); assert(r==0);
env->set_errfile(env, stderr); env->set_errfile(env, stderr);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE|DB_THREAD, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE|DB_THREAD, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=env->txn_begin(env, 0, &tid, 0); assert(r==0); r=env->txn_begin(env, 0, &tid, 0); assert(r==0);
r=db->open(db, tid, "foo.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=db->open(db, tid, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=tid->commit(tid, 0); assert(r==0); r=tid->commit(tid, 0); assert(r==0);
r=env->txn_begin(env, 0, &tid, 0); assert(r==0); r=env->txn_begin(env, 0, &tid, 0); assert(r==0);
...@@ -48,10 +48,10 @@ static void test (void) { ...@@ -48,10 +48,10 @@ static void test (void) {
r=db_env_create(&env, 0); assert(r==0); r=db_env_create(&env, 0); assert(r==0);
env->set_errfile(env, stderr); env->set_errfile(env, stderr);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE|DB_THREAD|DB_RECOVER, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE|DB_THREAD|DB_RECOVER, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=env->txn_begin(env, 0, &tid, 0); assert(r==0); r=env->txn_begin(env, 0, &tid, 0); assert(r==0);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=db->open(db, tid, "foo.db", 0, DB_BTREE, 0, 0777); CKERR(r); r=db->open(db, tid, "foo.db", 0, DB_BTREE, 0, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
for (i=0; i<N; i++) { for (i=0; i<N; i++) {
r=db->get(db, tid, dbt_init(&key, keys[i], 1+strlen(keys[i])), dbt_init_malloc(&data), 0); assert(r==0); r=db->get(db, tid, dbt_init(&key, keys[i], 1+strlen(keys[i])), dbt_init_malloc(&data), 0); assert(r==0);
assert(strcmp(data.data, vals[i])==0); assert(strcmp(data.data, vals[i])==0);
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
static void test (void) { static void test (void) {
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
DB_ENV *env; DB_ENV *env;
DB_TXN *tid; DB_TXN *tid;
...@@ -25,11 +25,11 @@ static void test (void) { ...@@ -25,11 +25,11 @@ static void test (void) {
r=db_env_create(&env, 0); assert(r==0); r=db_env_create(&env, 0); assert(r==0);
env->set_errfile(env, stderr); env->set_errfile(env, stderr);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE|DB_THREAD, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE|DB_THREAD, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=env->txn_begin(env, 0, &tid, 0); assert(r==0); r=env->txn_begin(env, 0, &tid, 0); assert(r==0);
r=db->open(db, tid, "foo.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=db->open(db, tid, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=tid->commit(tid, 0); assert(r==0); r=tid->commit(tid, 0); assert(r==0);
r=env->txn_begin(env, 0, &tid, 0); assert(r==0); r=env->txn_begin(env, 0, &tid, 0); assert(r==0);
...@@ -57,10 +57,10 @@ static void test (void) { ...@@ -57,10 +57,10 @@ static void test (void) {
r=db_env_create(&env, 0); assert(r==0); r=db_env_create(&env, 0); assert(r==0);
env->set_errfile(env, stderr); env->set_errfile(env, stderr);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE|DB_THREAD|DB_RECOVER, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE|DB_THREAD|DB_RECOVER, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=env->txn_begin(env, 0, &tid, 0); assert(r==0); r=env->txn_begin(env, 0, &tid, 0); assert(r==0);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=db->open(db, tid, "foo.db", 0, DB_BTREE, 0, 0777); CKERR(r); r=db->open(db, tid, "foo.db", 0, DB_BTREE, 0, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
for (i=0; i<N; i++) { for (i=0; i<N; i++) {
r=db->get(db, tid, dbt_init(&key, keys[i], 1+strlen(keys[i])), dbt_init_malloc(&data), 0); assert(r==0); r=db->get(db, tid, dbt_init(&key, keys[i], 1+strlen(keys[i])), dbt_init_malloc(&data), 0); assert(r==0);
assert(strcmp(data.data, vals[i])==0); assert(strcmp(data.data, vals[i])==0);
......
...@@ -121,19 +121,19 @@ int main(int argc, const char *argv[]) { ...@@ -121,19 +121,19 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv); parse_args(argc, argv);
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
int r; int r;
DB_TXN *txn; DB_TXN *txn;
{ {
r = db_env_create(&env, 0); CKERR(r); r = db_env_create(&env, 0); CKERR(r);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
env->set_errfile(env, stderr); env->set_errfile(env, stderr);
r=env->txn_begin(env, 0, &txn, 0); CKERR(r); r=env->txn_begin(env, 0, &txn, 0); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=db->set_flags(db, DB_DUP|DB_DUPSORT); r=db->set_flags(db, DB_DUP|DB_DUPSORT);
r=db->open(db, txn, "foo.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=db->open(db, txn, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=txn->commit(txn, 0); CKERR(r); r=txn->commit(txn, 0); CKERR(r);
} }
int i; int i;
......
...@@ -53,19 +53,19 @@ int main(int argc, const char *argv[]) { ...@@ -53,19 +53,19 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv); parse_args(argc, argv);
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
int r; int r;
DB_TXN *txn; DB_TXN *txn;
{ {
r = db_env_create(&env, 0); CKERR(r); r = db_env_create(&env, 0); CKERR(r);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
env->set_errfile(env, stderr); env->set_errfile(env, stderr);
r=env->txn_begin(env, 0, &txn, 0); CKERR(r); r=env->txn_begin(env, 0, &txn, 0); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=db->set_flags(db, DB_DUP|DB_DUPSORT); r=db->set_flags(db, DB_DUP|DB_DUPSORT);
r=db->open(db, txn, "foo.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=db->open(db, txn, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=txn->commit(txn, 0); CKERR(r); r=txn->commit(txn, 0); CKERR(r);
} }
run(); run();
......
...@@ -54,19 +54,19 @@ int main(int argc, const char *argv[]) { ...@@ -54,19 +54,19 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv); parse_args(argc, argv);
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
int r; int r;
DB_TXN *txn; DB_TXN *txn;
{ {
r = db_env_create(&env, 0); CKERR(r); r = db_env_create(&env, 0); CKERR(r);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
env->set_errfile(env, stderr); env->set_errfile(env, stderr);
r=env->txn_begin(env, 0, &txn, 0); CKERR(r); r=env->txn_begin(env, 0, &txn, 0); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=db->set_flags(db, DB_DUP|DB_DUPSORT); r=db->set_flags(db, DB_DUP|DB_DUPSORT);
r=db->open(db, txn, "foo.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=db->open(db, txn, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=txn->commit(txn, 0); CKERR(r); r=txn->commit(txn, 0); CKERR(r);
} }
run(); run();
......
...@@ -111,19 +111,19 @@ int main(int argc, const char *argv[]) { ...@@ -111,19 +111,19 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv); parse_args(argc, argv);
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
int r; int r;
DB_TXN *txn; DB_TXN *txn;
{ {
r = db_env_create(&env, 0); CKERR(r); r = db_env_create(&env, 0); CKERR(r);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
env->set_errfile(env, stderr); env->set_errfile(env, stderr);
r=env->txn_begin(env, 0, &txn, 0); CKERR(r); r=env->txn_begin(env, 0, &txn, 0); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=db->set_flags(db, DB_DUP|DB_DUPSORT); r=db->set_flags(db, DB_DUP|DB_DUPSORT);
r=db->open(db, txn, "foo.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=db->open(db, txn, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=txn->commit(txn, 0); CKERR(r); r=txn->commit(txn, 0); CKERR(r);
} }
int i; int i;
......
...@@ -108,18 +108,18 @@ int main(int argc, const char *argv[]) { ...@@ -108,18 +108,18 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv); parse_args(argc, argv);
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
int r; int r;
DB_TXN *txn; DB_TXN *txn;
{ {
r = db_env_create(&env, 0); CKERR(r); r = db_env_create(&env, 0); CKERR(r);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
env->set_errfile(env, stderr); env->set_errfile(env, stderr);
r=env->txn_begin(env, 0, &txn, 0); CKERR(r); r=env->txn_begin(env, 0, &txn, 0); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=db->open(db, txn, "foo.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=db->open(db, txn, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=txn->commit(txn, 0); CKERR(r); r=txn->commit(txn, 0); CKERR(r);
} }
int i; int i;
......
...@@ -15,7 +15,7 @@ test_789(void) { ...@@ -15,7 +15,7 @@ test_789(void) {
/* setup test directory */ /* setup test directory */
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
/* setup environment */ /* setup environment */
DB_ENV *env; DB_ENV *env;
...@@ -24,7 +24,7 @@ test_789(void) { ...@@ -24,7 +24,7 @@ test_789(void) {
r = env->set_data_dir(env, ENVDIR); r = env->set_data_dir(env, ENVDIR);
r = env->set_lg_dir(env, ENVDIR); r = env->set_lg_dir(env, ENVDIR);
env->set_errfile(env, stdout); env->set_errfile(env, stdout);
r = env->open(env, 0, DB_INIT_MPOOL + DB_INIT_LOG + DB_INIT_LOCK + DB_INIT_TXN + DB_PRIVATE + DB_CREATE, 0777); r = env->open(env, 0, DB_INIT_MPOOL + DB_INIT_LOG + DB_INIT_LOCK + DB_INIT_TXN + DB_PRIVATE + DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO);
assert(r == 0); assert(r == 0);
} }
...@@ -35,7 +35,7 @@ test_789(void) { ...@@ -35,7 +35,7 @@ test_789(void) {
r = env->txn_begin(env, 0, &txn, 0); assert(r == 0); r = env->txn_begin(env, 0, &txn, 0); assert(r == 0);
r = db_create(&db, env, 0); assert(r == 0); r = db_create(&db, env, 0); assert(r == 0);
r = db->open(db, txn, "test.db", 0, DB_BTREE, DB_CREATE, 0777); assert(r == 0); r = db->open(db, txn, "test.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
r = txn->commit(txn, 0); assert(r == 0); r = txn->commit(txn, 0); assert(r == 0);
} }
......
...@@ -17,7 +17,7 @@ testit (const int klen, const int vlen, const int n, const int lastvlen) { ...@@ -17,7 +17,7 @@ testit (const int klen, const int vlen, const int n, const int lastvlen) {
// setup test directory // setup test directory
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
// setup environment // setup environment
DB_ENV *env; DB_ENV *env;
...@@ -26,7 +26,7 @@ testit (const int klen, const int vlen, const int n, const int lastvlen) { ...@@ -26,7 +26,7 @@ testit (const int klen, const int vlen, const int n, const int lastvlen) {
r = env->set_data_dir(env, ENVDIR); r = env->set_data_dir(env, ENVDIR);
r = env->set_lg_dir(env, ENVDIR); r = env->set_lg_dir(env, ENVDIR);
env->set_errfile(env, stdout); env->set_errfile(env, stdout);
r = env->open(env, 0, DB_INIT_MPOOL + DB_PRIVATE + DB_CREATE, 0777); r = env->open(env, 0, DB_INIT_MPOOL + DB_PRIVATE + DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO);
assert(r == 0); assert(r == 0);
} }
...@@ -35,7 +35,7 @@ testit (const int klen, const int vlen, const int n, const int lastvlen) { ...@@ -35,7 +35,7 @@ testit (const int klen, const int vlen, const int n, const int lastvlen) {
{ {
DB_TXN *txn = 0; DB_TXN *txn = 0;
r = db_create(&db, env, 0); assert(r == 0); r = db_create(&db, env, 0); assert(r == 0);
r = db->open(db, txn, "test.db", 0, DB_BTREE, DB_CREATE, 0777); assert(r == 0); r = db->open(db, txn, "test.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
} }
// insert to fill up a node // insert to fill up a node
......
...@@ -23,15 +23,15 @@ test_db_open_aborts (void) { ...@@ -23,15 +23,15 @@ test_db_open_aborts (void) {
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r=db_env_create(&env, 0); assert(r==0); r=db_env_create(&env, 0); assert(r==0);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_PRIVATE|DB_CREATE, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_PRIVATE|DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
#if 0 #if 0
{ {
DB_TXN *tid; DB_TXN *tid;
r=env->txn_begin(env, 0, &tid, 0); assert(r==0); r=env->txn_begin(env, 0, &tid, 0); assert(r==0);
r=db->open(db, tid, "foo.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=db->open(db, tid, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=tid->abort(tid); assert(r==0); r=tid->abort(tid); assert(r==0);
} }
{ {
...@@ -77,15 +77,15 @@ test_db_put_aborts (void) { ...@@ -77,15 +77,15 @@ test_db_put_aborts (void) {
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r=db_env_create(&env, 0); assert(r==0); r=db_env_create(&env, 0); assert(r==0);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_PRIVATE|DB_CREATE, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_PRIVATE|DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
{ {
DB_TXN *tid; DB_TXN *tid;
r=env->txn_begin(env, 0, &tid, 0); assert(r==0); r=env->txn_begin(env, 0, &tid, 0); assert(r==0);
r=db->open(db, tid, "foo.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=db->open(db, tid, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=tid->commit(tid,0); assert(r==0); r=tid->commit(tid,0); assert(r==0);
} }
{ {
......
...@@ -30,15 +30,15 @@ static void ...@@ -30,15 +30,15 @@ static void
do_test_abort2 (void) { do_test_abort2 (void) {
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r=db_env_create(&env, 0); assert(r==0); r=db_env_create(&env, 0); assert(r==0);
env->set_errfile(env, stderr); env->set_errfile(env, stderr);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=db->set_pagesize(db, 4096); // Use a small page r=db->set_pagesize(db, 4096); // Use a small page
r=env->txn_begin(env, 0, &txn, 0); assert(r==0); r=env->txn_begin(env, 0, &txn, 0); assert(r==0);
r=db->open(db, txn, "foo.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=db->open(db, txn, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=txn->commit(txn, 0); assert(r==0); r=txn->commit(txn, 0); assert(r==0);
r=env->txn_begin(env, 0, &txn, 0); assert(r==0); r=env->txn_begin(env, 0, &txn, 0); assert(r==0);
...@@ -57,10 +57,10 @@ do_test_abort2 (void) { ...@@ -57,10 +57,10 @@ do_test_abort2 (void) {
// Now do a few inserts that abort. // Now do a few inserts that abort.
r=db_env_create(&env, 0); assert(r==0); r=db_env_create(&env, 0); assert(r==0);
env->set_errfile(env, stderr); env->set_errfile(env, stderr);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=env->txn_begin(env, 0, &txn, 0); CKERR(r); r=env->txn_begin(env, 0, &txn, 0); CKERR(r);
r=db->open(db, txn, "foo.db", 0, DB_BTREE, 0, 0777); CKERR(r); r=db->open(db, txn, "foo.db", 0, DB_BTREE, 0, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
#ifndef TOKUDB #ifndef TOKUDB
{ {
u_int32_t ps; u_int32_t ps;
...@@ -89,7 +89,7 @@ do_test_abort2 (void) { ...@@ -89,7 +89,7 @@ do_test_abort2 (void) {
//printf("%s:%d\n", __FILE__, __LINE__); //printf("%s:%d\n", __FILE__, __LINE__);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=env->txn_begin(env, 0, &txn, 0); assert(r==0); r=env->txn_begin(env, 0, &txn, 0); assert(r==0);
r=db->open(db, txn, "foo.db", 0, DB_BTREE, 0, 0777); CKERR(r); r=db->open(db, txn, "foo.db", 0, DB_BTREE, 0, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=txn->commit(txn, 0); CKERR(r); r=txn->commit(txn, 0); CKERR(r);
//printf("%s:%d\n", __FILE__, __LINE__); //printf("%s:%d\n", __FILE__, __LINE__);
......
...@@ -66,15 +66,15 @@ static void ...@@ -66,15 +66,15 @@ static void
test_abort3 (void) { test_abort3 (void) {
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r=db_env_create(&env, 0); assert(r==0); r=db_env_create(&env, 0); assert(r==0);
env->set_errfile(env, stderr); env->set_errfile(env, stderr);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=env->txn_begin(env, 0, &txn, 0); assert(r==0); r=env->txn_begin(env, 0, &txn, 0); assert(r==0);
r=db->open(db, txn, "foo.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=db->open(db, txn, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
insert(0, 0); insert(0, 0);
r=txn->commit(txn, 0); assert(r==0); r=txn->commit(txn, 0); assert(r==0);
......
...@@ -81,15 +81,15 @@ do_abort_delete_first_or_last(int N, ...@@ -81,15 +81,15 @@ do_abort_delete_first_or_last(int N,
) { ) {
int r,i; int r,i;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r=db_env_create(&env, 0); assert(r==0); r=db_env_create(&env, 0); assert(r==0);
env->set_errfile(env, stderr); env->set_errfile(env, stderr);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=db->set_pagesize(db, 4096); // Use a small page r=db->set_pagesize(db, 4096); // Use a small page
r=env->txn_begin(env, 0, &txn, 0); assert(r==0); r=env->txn_begin(env, 0, &txn, 0); assert(r==0);
r=db->open(db, txn, "foo.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=db->open(db, txn, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=txn->commit(txn, 0); assert(r==0); r=txn->commit(txn, 0); assert(r==0);
// First fill up the db // First fill up the db
......
...@@ -14,14 +14,14 @@ int main (int argc, const char *argv[]) { ...@@ -14,14 +14,14 @@ int main (int argc, const char *argv[]) {
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r=db_env_create(&env, 0); CKERR(r); r=db_env_create(&env, 0); CKERR(r);
env->set_errfile(env, stderr); env->set_errfile(env, stderr);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=env->txn_begin(env, 0, &txn, 0); CKERR(r); r=env->txn_begin(env, 0, &txn, 0); CKERR(r);
r=db->open(db, txn, "foo.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=db->open(db, txn, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=txn->commit(txn, 0); CKERR(r); r=txn->commit(txn, 0); CKERR(r);
char **list; char **list;
......
...@@ -12,15 +12,15 @@ int main (int argc, const char *argv[]) { ...@@ -12,15 +12,15 @@ int main (int argc, const char *argv[]) {
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r=db_env_create(&env, 0); CKERR(r); r=db_env_create(&env, 0); CKERR(r);
env->set_errfile(env, stderr); env->set_errfile(env, stderr);
r=env->set_lg_max(env, 16000); CKERR(r); r=env->set_lg_max(env, 16000); CKERR(r);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=env->txn_begin(env, 0, &txn, 0); CKERR(r); r=env->txn_begin(env, 0, &txn, 0); CKERR(r);
r=db->open(db, txn, "foo.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=db->open(db, txn, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=txn->commit(txn, 0); CKERR(r); r=txn->commit(txn, 0); CKERR(r);
int i; int i;
......
...@@ -13,21 +13,21 @@ int main (int argc, const char *argv[]) { ...@@ -13,21 +13,21 @@ int main (int argc, const char *argv[]) {
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r=db_env_create(&env, 0); CKERR(r); r=db_env_create(&env, 0); CKERR(r);
env->set_errfile(env, stderr); env->set_errfile(env, stderr);
r=env->set_lg_max(env, 20000); CKERR(r); r=env->set_lg_max(env, 20000); CKERR(r);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=env->txn_begin(env, 0, &txn, 0); CKERR(r); r=env->txn_begin(env, 0, &txn, 0); CKERR(r);
r=db->open(db, txn, "foo.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=db->open(db, txn, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=txn->commit(txn, 0); CKERR(r); r=txn->commit(txn, 0); CKERR(r);
r=db_create(&db2, env, 0); CKERR(r); r=db_create(&db2, env, 0); CKERR(r);
r=env->txn_begin(env, 0, &txn, 0); CKERR(r); r=env->txn_begin(env, 0, &txn, 0); CKERR(r);
r=db->open(db2, txn, "foo2.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=db->open(db2, txn, "foo2.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=txn->commit(txn, 0); CKERR(r); r=txn->commit(txn, 0); CKERR(r);
r=env->txn_begin(env, 0, &txn2, 0); CKERR(r); r=env->txn_begin(env, 0, &txn2, 0); CKERR(r);
......
...@@ -26,7 +26,7 @@ test_cursor (void) { ...@@ -26,7 +26,7 @@ test_cursor (void) {
/* create the dup database file */ /* create the dup database file */
r = db_env_create(&env, 0); assert(r == 0); r = db_env_create(&env, 0); assert(r == 0);
env->set_errfile(env, stderr); env->set_errfile(env, stderr);
r = env->open(env, ENVDIR, DB_CREATE|DB_INIT_MPOOL|DB_THREAD|DB_PRIVATE, 0777); CKERR(r); r = env->open(env, ENVDIR, DB_CREATE|DB_INIT_MPOOL|DB_THREAD|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r = db_create(&db, env, 0); assert(r == 0); r = db_create(&db, env, 0); assert(r == 0);
db->set_errfile(db,stderr); // Turn off those annoying errors db->set_errfile(db,stderr); // Turn off those annoying errors
r = db->open(db, null_txn, fname, "main", DB_BTREE, DB_CREATE, 0666); assert(r == 0); r = db->open(db, null_txn, fname, "main", DB_BTREE, DB_CREATE, 0666); assert(r == 0);
...@@ -83,7 +83,7 @@ int main(int argc, const char *argv[]) { ...@@ -83,7 +83,7 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv); parse_args(argc, argv);
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
test_cursor(); test_cursor();
......
...@@ -59,7 +59,7 @@ test (void) { ...@@ -59,7 +59,7 @@ test (void) {
/* create the dup database file */ /* create the dup database file */
r = db_env_create(&env, 0); assert(r == 0); r = db_env_create(&env, 0); assert(r == 0);
env->set_errfile(env, stderr); env->set_errfile(env, stderr);
r = env->open(env, ENVDIR, DB_CREATE|DB_INIT_MPOOL|DB_THREAD|DB_PRIVATE, 0777); CKERR(r); r = env->open(env, ENVDIR, DB_CREATE|DB_INIT_MPOOL|DB_THREAD|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r = db_create(&db, env, 0); assert(r == 0); r = db_create(&db, env, 0); assert(r == 0);
db->set_errfile(db,stderr); // Turn off those annoying errors db->set_errfile(db,stderr); // Turn off those annoying errors
r = db->open(db, null_txn, fname, "main", DB_BTREE, DB_CREATE, 0666); assert(r == 0); r = db->open(db, null_txn, fname, "main", DB_BTREE, DB_CREATE, 0666); assert(r == 0);
...@@ -95,7 +95,7 @@ int main(int argc, const char *argv[]) { ...@@ -95,7 +95,7 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv); parse_args(argc, argv);
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
test(); test();
......
...@@ -23,12 +23,12 @@ static DB_TXN* null_txn = NULL; ...@@ -23,12 +23,12 @@ static DB_TXN* null_txn = NULL;
static void setup_env(void) { static void setup_env(void) {
assert(!env && !db && !cursor); assert(!env && !db && !cursor);
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
r = db_env_create(&env, 0); r = db_env_create(&env, 0);
CKERR(r); CKERR(r);
assert(env); assert(env);
env->set_errfile(env, stderr); env->set_errfile(env, stderr);
r = env->open(env, ENVDIR, DB_CREATE|DB_INIT_MPOOL|DB_THREAD|DB_PRIVATE, 0777); r = env->open(env, ENVDIR, DB_CREATE|DB_INIT_MPOOL|DB_THREAD|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO);
CKERR(r); CKERR(r);
assert(env); assert(env);
} }
......
...@@ -120,7 +120,7 @@ int main(int argc, const char *argv[]) { ...@@ -120,7 +120,7 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv); parse_args(argc, argv);
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
test_cursor_current(); test_cursor_current();
test_reopen(); test_reopen();
......
...@@ -65,7 +65,7 @@ int main(int argc, const char *argv[]) { ...@@ -65,7 +65,7 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv); parse_args(argc, argv);
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
test_cursor_delete2(); test_cursor_delete2();
......
...@@ -67,7 +67,7 @@ int main(int argc, const char *argv[]) { ...@@ -67,7 +67,7 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv); parse_args(argc, argv);
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
test_cursor_delete2(); test_cursor_delete2();
......
...@@ -25,7 +25,7 @@ setup_db (char* name) { ...@@ -25,7 +25,7 @@ setup_db (char* name) {
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
r = db_env_create(&env, 0); CKERR(r); r = db_env_create(&env, 0); CKERR(r);
r = env->open(env, ENVDIR, DB_CREATE | DB_PRIVATE | DB_INIT_MPOOL, 0666); CKERR(r); r = env->open(env, ENVDIR, DB_CREATE | DB_PRIVATE | DB_INIT_MPOOL, 0666); CKERR(r);
......
...@@ -45,7 +45,7 @@ int main(int argc, const char *argv[]) { ...@@ -45,7 +45,7 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv); parse_args(argc, argv);
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
test_cursor_flags(0, 0); test_cursor_flags(0, 0);
test_cursor_flags(~0, EINVAL); test_cursor_flags(~0, EINVAL);
......
...@@ -92,7 +92,7 @@ int main(int argc, const char *argv[]) { ...@@ -92,7 +92,7 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv); parse_args(argc, argv);
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
int r=mkdir(ENVDIR, 0777); assert(r==0); int r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
int i; int i;
for (i=1; i<=65536; i *= 2) { for (i=1; i<=65536; i *= 2) {
......
...@@ -111,7 +111,7 @@ setup_dbs (u_int32_t dup_flags) { ...@@ -111,7 +111,7 @@ setup_dbs (u_int32_t dup_flags) {
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
dbenv = NULL; dbenv = NULL;
db = NULL; db = NULL;
/* Open/create primary */ /* Open/create primary */
......
...@@ -22,7 +22,7 @@ int main() { ...@@ -22,7 +22,7 @@ int main() {
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r=chdir(ENVDIR); assert(r==0); r=chdir(ENVDIR); assert(r==0);
r = db_create(&db, null_env, 0); CKERR(r); r = db_create(&db, null_env, 0); CKERR(r);
......
...@@ -557,7 +557,7 @@ int main (int argc, const char *argv[]) { ...@@ -557,7 +557,7 @@ int main (int argc, const char *argv[]) {
switch (mode) { switch (mode) {
case MODE_DEFAULT: case MODE_DEFAULT:
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
create_databases(); create_databases();
{ {
int i; int i;
......
...@@ -19,9 +19,9 @@ DB *db; ...@@ -19,9 +19,9 @@ DB *db;
int main (int UU(argc), char UU(*argv[])) { int main (int UU(argc), char UU(*argv[])) {
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r=db_env_create(&env, 0); assert(r==0); r=db_env_create(&env, 0); assert(r==0);
r=env->open(env, ENVDIR, DB_PRIVATE|DB_CREATE, 0777); assert(r==0); r=env->open(env, ENVDIR, DB_PRIVATE|DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r=db_create(&db, env, 0); assert(r==0); r=db_create(&db, env, 0); assert(r==0);
r=db->close(db, 0); assert(r==0); r=db->close(db, 0); assert(r==0);
r=env->close(env, 0); assert(r==0); r=env->close(env, 0); assert(r==0);
......
...@@ -20,9 +20,9 @@ DB_TXN* null_txn = NULL; ...@@ -20,9 +20,9 @@ DB_TXN* null_txn = NULL;
int main (int UU(argc), char UU(*argv[])) { int main (int UU(argc), char UU(*argv[])) {
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); CKERR(r); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_env_create(&env, 0); CKERR(r); r=db_env_create(&env, 0); CKERR(r);
r=env->open(env, ENVDIR, DB_PRIVATE|DB_INIT_MPOOL|DB_CREATE, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_PRIVATE|DB_INIT_MPOOL|DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r = db->open(db, null_txn, "foo.db", "main", DB_BTREE, DB_CREATE, 0666); CKERR(r); r = db->open(db, null_txn, "foo.db", "main", DB_BTREE, DB_CREATE, 0666); CKERR(r);
DBC *cursor; DBC *cursor;
......
...@@ -530,7 +530,7 @@ int main (int argc, const char *argv[]) { ...@@ -530,7 +530,7 @@ int main (int argc, const char *argv[]) {
case MODE_DEFAULT: case MODE_DEFAULT:
oppass=1; oppass=1;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
create_databases(); create_databases();
{ {
int i; int i;
......
...@@ -335,7 +335,7 @@ int main (int argc, const char *argv[]) { ...@@ -335,7 +335,7 @@ int main (int argc, const char *argv[]) {
case MODE_DEFAULT: case MODE_DEFAULT:
opnum=0; opnum=0;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
create_databases(); create_databases();
{ {
int i; int i;
......
...@@ -141,7 +141,7 @@ int main(int argc, const char *argv[]) { ...@@ -141,7 +141,7 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv); parse_args(argc, argv);
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
second_setup(); second_setup();
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
callback_set_malloc = i & 0x1; callback_set_malloc = i & 0x1;
......
...@@ -83,7 +83,7 @@ static void second_setup (u_int32_t dupflags) { ...@@ -83,7 +83,7 @@ static void second_setup (u_int32_t dupflags) {
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
dbenv = 0; dbenv = 0;
/* Open/create primary */ /* Open/create primary */
r = db_create(&db, dbenv, 0); CKERR(r); r = db_create(&db, dbenv, 0); CKERR(r);
......
...@@ -28,7 +28,7 @@ setup(void) { ...@@ -28,7 +28,7 @@ setup(void) {
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
dbenv = 0; dbenv = 0;
/* Open/create primary */ /* Open/create primary */
r = db_create(&db, dbenv, 0); CKERR(r); r = db_create(&db, dbenv, 0); CKERR(r);
......
...@@ -53,7 +53,7 @@ test_db_delboth (int n, int dup_mode) { ...@@ -53,7 +53,7 @@ test_db_delboth (int n, int dup_mode) {
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
/* create the dup database file */ /* create the dup database file */
r = db_create(&db, null_env, 0); r = db_create(&db, null_env, 0);
......
...@@ -47,7 +47,7 @@ test_db_delete (int n, int dup_mode) { ...@@ -47,7 +47,7 @@ test_db_delete (int n, int dup_mode) {
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
/* create the dup database file */ /* create the dup database file */
r = db_create(&db, null_env, 0); r = db_create(&db, null_env, 0);
...@@ -113,7 +113,7 @@ test_db_get_datasize0 (void) { ...@@ -113,7 +113,7 @@ test_db_get_datasize0 (void) {
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
/* create the dup database file */ /* create the dup database file */
r = db_create(&db, null_env, 0); r = db_create(&db, null_env, 0);
......
...@@ -130,7 +130,7 @@ int main(int argc, const char *argv[]) { ...@@ -130,7 +130,7 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv); parse_args(argc, argv);
for (i = 0; i < (1<<3); i++) { for (i = 0; i < (1<<3); i++) {
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
second_setup(); second_setup();
check_secondary(DB_NOTFOUND); check_secondary(DB_NOTFOUND);
......
...@@ -43,17 +43,17 @@ reinit_config (int set_home, int set_DB_ENVIRON, int set_DB_HOME) { ...@@ -43,17 +43,17 @@ reinit_config (int set_home, int set_DB_ENVIRON, int set_DB_HOME) {
r = fchdir(rootfd); assert(r == 0); r = fchdir(rootfd); assert(r == 0);
r = system("rm -rf " ENVDIR); assert(r == 0); r = system("rm -rf " ENVDIR); assert(r == 0);
r = mkdir(ENVDIR, 0777); assert(r == 0); r = toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
r = chdir(ENVDIR); assert(r == 0); r = chdir(ENVDIR); assert(r == 0);
unsetenv(DB_HOME); unsetenv(DB_HOME);
if (set_home) { if (set_home) {
db_dir = "home"; db_dir = "home";
r = mkdir(db_dir, 0777); assert(r == 0); r = toku_os_mkdir(db_dir, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
} }
else if (set_DB_ENVIRON && set_DB_HOME) { else if (set_DB_ENVIRON && set_DB_HOME) {
db_dir = "DB_HOME"; db_dir = "DB_HOME";
r = mkdir(db_dir, 0777); assert(r == 0); r = toku_os_mkdir(db_dir, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
} }
else db_dir = "."; else db_dir = ".";
......
...@@ -43,7 +43,7 @@ int main() { ...@@ -43,7 +43,7 @@ int main() {
dbenv->close(dbenv,0); // free memory dbenv->close(dbenv,0); // free memory
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
r = db_env_create(&dbenv, 0); r = db_env_create(&dbenv, 0);
CKERR(r); CKERR(r);
r = dbenv->open(dbenv, ENVDIR, private_flags|DB_INIT_MPOOL, 0); r = dbenv->open(dbenv, ENVDIR, private_flags|DB_INIT_MPOOL, 0);
...@@ -62,7 +62,7 @@ int main() { ...@@ -62,7 +62,7 @@ int main() {
// Now make sure that if we have a non-private DB that we can tell if it opened or not. // Now make sure that if we have a non-private DB that we can tell if it opened or not.
DB *db; DB *db;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
r = db_env_create(&dbenv, 0); r = db_env_create(&dbenv, 0);
CKERR(r); CKERR(r);
r = dbenv->open(dbenv, ENVDIR, DB_CREATE|DB_INIT_MPOOL, 0); r = dbenv->open(dbenv, ENVDIR, DB_CREATE|DB_INIT_MPOOL, 0);
......
...@@ -21,7 +21,7 @@ int main(int argc, char** argv) { ...@@ -21,7 +21,7 @@ int main(int argc, char** argv) {
if (argc == 2 && !strcmp(argv[1], "-v")) verbose = 1; if (argc == 2 && !strcmp(argv[1], "-v")) verbose = 1;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r = db_env_create(&dbenv, 0); r = db_env_create(&dbenv, 0);
assert(r == 0); assert(r == 0);
......
...@@ -18,7 +18,7 @@ int main() { ...@@ -18,7 +18,7 @@ int main() {
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
r = db_env_create(&dbenv, 0); assert(r == 0); r = db_env_create(&dbenv, 0); assert(r == 0);
...@@ -39,7 +39,7 @@ int main() { ...@@ -39,7 +39,7 @@ int main() {
DB *db; DB *db;
r = db_create(&db, dbenv, 0); assert(r == 0); r = db_create(&db, dbenv, 0); assert(r == 0);
r = db->open(db, 0, "test.db", "main", DB_BTREE, DB_CREATE, 0777); assert(r == 0); r = db->open(db, 0, "test.db", "main", DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
r = db->close(db, 0); assert(r == 0); r = db->close(db, 0); assert(r == 0);
......
...@@ -16,7 +16,7 @@ int main() { ...@@ -16,7 +16,7 @@ int main() {
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
r = db_env_create(&dbenv, 0); r = db_env_create(&dbenv, 0);
assert(r == 0); assert(r == 0);
......
...@@ -19,7 +19,7 @@ int main() { ...@@ -19,7 +19,7 @@ int main() {
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
r = db_env_create(&dbenv, 0); r = db_env_create(&dbenv, 0);
assert(r == 0); assert(r == 0);
......
...@@ -19,7 +19,7 @@ int main() { ...@@ -19,7 +19,7 @@ int main() {
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
r = db_env_create(&dbenv, 0); r = db_env_create(&dbenv, 0);
assert(r == 0); assert(r == 0);
......
...@@ -19,12 +19,12 @@ DB *db; ...@@ -19,12 +19,12 @@ DB *db;
int main (int UU(argc), char UU(*argv[])) { int main (int UU(argc), char UU(*argv[])) {
int r; int r;
r=system("rm -rf " ENVDIR); assert(r==0); r=system("rm -rf " ENVDIR); assert(r==0);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r=db_env_create(&env, 0); assert(r==0); r=db_env_create(&env, 0); assert(r==0);
// None of this stuff works with BDB. TDB does more error checking. // None of this stuff works with BDB. TDB does more error checking.
#ifdef USE_TDB #ifdef USE_TDB
r=env->set_data_dir(env, NULL); assert(r==EINVAL); r=env->set_data_dir(env, NULL); assert(r==EINVAL);
r=env->open(env, ENVDIR, DB_PRIVATE, 0777); assert(r==0); r=env->open(env, ENVDIR, DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
env->set_errpfx(env, NULL); assert(1); //Did not crash. env->set_errpfx(env, NULL); assert(1); //Did not crash.
r=env->set_tmp_dir(env, NULL); assert(r==EINVAL); r=env->set_tmp_dir(env, NULL); assert(r==EINVAL);
#endif #endif
......
...@@ -59,7 +59,7 @@ setup (u_int32_t flags) { ...@@ -59,7 +59,7 @@ setup (u_int32_t flags) {
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
/* Open/create primary */ /* Open/create primary */
r = db_create(&dbp, dbenv, 0); CKERR(r); r = db_create(&dbp, dbenv, 0); CKERR(r);
dbp->set_errfile(dbp,0); // Turn off those annoying errors dbp->set_errfile(dbp,0); // Turn off those annoying errors
......
...@@ -19,9 +19,9 @@ DB *db; ...@@ -19,9 +19,9 @@ DB *db;
int main (int UU(argc), char UU(*argv[])) { int main (int UU(argc), char UU(*argv[])) {
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r=db_env_create(&env, 0); CKERR(r); r=db_env_create(&env, 0); CKERR(r);
r=env->open(env, ENVDIR, DB_PRIVATE|DB_INIT_MPOOL|DB_CREATE, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_PRIVATE|DB_INIT_MPOOL|DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=db->open(db, NULL, "doesnotexist.db", "testdb", DB_BTREE, 0, 0666); assert(r==ENOENT); r=db->open(db, NULL, "doesnotexist.db", "testdb", DB_BTREE, 0, 0666); assert(r==ENOENT);
r=db->open(db, NULL, "doesnotexist.db", "testdb", DB_BTREE, DB_CREATE, 0666); CKERR(r); r=db->open(db, NULL, "doesnotexist.db", "testdb", DB_BTREE, DB_CREATE, 0666); CKERR(r);
......
...@@ -22,14 +22,14 @@ DBT data; ...@@ -22,14 +22,14 @@ DBT data;
int main (int UU(argc), char UU(*argv[])) { int main (int UU(argc), char UU(*argv[])) {
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
memset(&key, 0, sizeof(key)); memset(&key, 0, sizeof(key));
memset(&data, 0, sizeof(data)); memset(&data, 0, sizeof(data));
key.size = sizeof("name"); key.size = sizeof("name");
key.data = "name"; key.data = "name";
r=db_env_create(&env, 0); assert(r==0); r=db_env_create(&env, 0); assert(r==0);
r=env->open(env, ENVDIR, DB_INIT_MPOOL|DB_PRIVATE|DB_CREATE, 0777); assert(r==0); r=env->open(env, ENVDIR, DB_INIT_MPOOL|DB_PRIVATE|DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r=db_create(&db, env, 0); assert(r==0); r=db_create(&db, env, 0); assert(r==0);
r=db->open(db, NULL, "master.db", NULL, DB_BTREE, DB_CREATE, 0666); assert(r==0); r=db->open(db, NULL, "master.db", NULL, DB_BTREE, DB_CREATE, 0666); assert(r==0);
......
...@@ -22,7 +22,7 @@ DBT data; ...@@ -22,7 +22,7 @@ DBT data;
int main (int UU(argc), char UU(*argv[])) { int main (int UU(argc), char UU(*argv[])) {
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
memset(&key, 0, sizeof(key)); memset(&key, 0, sizeof(key));
memset(&data, 0, sizeof(data)); memset(&data, 0, sizeof(data));
key.size = sizeof("name"); key.size = sizeof("name");
...@@ -30,7 +30,7 @@ int main (int UU(argc), char UU(*argv[])) { ...@@ -30,7 +30,7 @@ int main (int UU(argc), char UU(*argv[])) {
r=db_env_create(&env, 0); assert(r==0); r=db_env_create(&env, 0); assert(r==0);
// Note: without DB_INIT_MPOOL the BDB library will fail on db->open(). // Note: without DB_INIT_MPOOL the BDB library will fail on db->open().
r=env->open(env, ENVDIR, DB_INIT_MPOOL|DB_PRIVATE|DB_CREATE, 0777); assert(r==0); r=env->open(env, ENVDIR, DB_INIT_MPOOL|DB_PRIVATE|DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r=db_create(&db, env, 0); assert(r==0); r=db_create(&db, env, 0); assert(r==0);
r=db->remove(db, "DoesNotExist.db", NULL, 0); assert(r==ENOENT); r=db->remove(db, "DoesNotExist.db", NULL, 0); assert(r==ENOENT);
......
...@@ -192,7 +192,7 @@ int main() { ...@@ -192,7 +192,7 @@ int main() {
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
second_setup(); second_setup();
insert_test(); insert_test();
......
...@@ -38,7 +38,7 @@ int main(int argc, const char *argv[]) { ...@@ -38,7 +38,7 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv); parse_args(argc, argv);
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
test_db_set_flags(0, 0, 0, 0); test_db_set_flags(0, 0, 0, 0);
test_db_set_flags(0, 0, DB_DUP, EINVAL); test_db_set_flags(0, 0, DB_DUP, EINVAL);
......
...@@ -22,11 +22,11 @@ int main() { ...@@ -22,11 +22,11 @@ int main() {
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r=db_env_create(&env, 0); assert(r==0); r=db_env_create(&env, 0); assert(r==0);
// Note: without DB_INIT_MPOOL the BDB library will fail on db->open(). // Note: without DB_INIT_MPOOL the BDB library will fail on db->open().
r=env->open(env, ENVDIR, DB_INIT_MPOOL|DB_PRIVATE|DB_CREATE|DB_INIT_LOG, 0777); assert(r==0); r=env->open(env, ENVDIR, DB_INIT_MPOOL|DB_PRIVATE|DB_CREATE|DB_INIT_LOG, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r = db_create(&db, env, 0); r = db_create(&db, env, 0);
CKERR(r); CKERR(r);
......
...@@ -22,11 +22,11 @@ int main() { ...@@ -22,11 +22,11 @@ int main() {
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r=db_env_create(&env, 0); assert(r==0); r=db_env_create(&env, 0); assert(r==0);
// Note: without DB_INIT_MPOOL the BDB library will fail on db->open(). // Note: without DB_INIT_MPOOL the BDB library will fail on db->open().
r=env->open(env, ENVDIR, DB_INIT_MPOOL|DB_PRIVATE|DB_CREATE|DB_INIT_LOG, 0777); assert(r==0); r=env->open(env, ENVDIR, DB_INIT_MPOOL|DB_PRIVATE|DB_CREATE|DB_INIT_LOG, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r = db_create(&db, env, 0); CKERR(r); r = db_create(&db, env, 0); CKERR(r);
r = db->open(db, null_txn, fname, "main", DB_BTREE, DB_CREATE, 0666); CKERR(r); r = db->open(db, null_txn, fname, "main", DB_BTREE, DB_CREATE, 0666); CKERR(r);
......
...@@ -187,7 +187,7 @@ setup_dbs (u_int32_t dup_flags) { ...@@ -187,7 +187,7 @@ setup_dbs (u_int32_t dup_flags) {
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
dbenv = NULL; dbenv = NULL;
db = NULL; db = NULL;
/* Open/create primary */ /* Open/create primary */
......
...@@ -86,7 +86,7 @@ setup_dbs (u_int32_t dup_flags) { ...@@ -86,7 +86,7 @@ setup_dbs (u_int32_t dup_flags) {
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
dbenv = NULL; dbenv = NULL;
db = NULL; db = NULL;
/* Open/create primary */ /* Open/create primary */
......
...@@ -723,7 +723,7 @@ int main(int argc, const char *argv[]) { ...@@ -723,7 +723,7 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv); parse_args(argc, argv);
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
#ifdef USE_BDB #ifdef USE_BDB
/* dup tests */ /* dup tests */
......
...@@ -227,7 +227,7 @@ int main(int argc, const char *argv[]) { ...@@ -227,7 +227,7 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv); parse_args(argc, argv);
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
test_put_00_01_01(0, 0); test_put_00_01_01(0, 0);
test_put_00_01_01(0, DB_NOOVERWRITE); test_put_00_01_01(0, DB_NOOVERWRITE);
......
...@@ -73,7 +73,7 @@ int main(int argc, const char *argv[]) { ...@@ -73,7 +73,7 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv); parse_args(argc, argv);
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
/* test flags */ /* test flags */
test_dup_flags(0); test_dup_flags(0);
......
...@@ -255,7 +255,7 @@ int main(int argc, const char *argv[]) { ...@@ -255,7 +255,7 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv); parse_args(argc, argv);
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
/* nodup tests */ /* nodup tests */
for (i = 1; i <= (1<<16); i *= 2) { for (i = 1; i <= (1<<16); i *= 2) {
......
...@@ -133,7 +133,7 @@ int main(int argc, const char *argv[]) { ...@@ -133,7 +133,7 @@ int main(int argc, const char *argv[]) {
} }
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
for (i = 1; i <= 65536; i = testlevel ? i+1 : i*2) { for (i = 1; i <= 65536; i = testlevel ? i+1 : i*2) {
test_dup_next(i, DB_DUP + DB_DUPSORT); test_dup_next(i, DB_DUP + DB_DUPSORT);
......
...@@ -326,7 +326,7 @@ int main(int argc, const char *argv[]) { ...@@ -326,7 +326,7 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv); parse_args(argc, argv);
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
int limit = 1<<13; int limit = 1<<13;
if (verbose > 1) if (verbose > 1)
......
...@@ -71,16 +71,16 @@ static void ...@@ -71,16 +71,16 @@ static void
test_dupsort_del (void) { test_dupsort_del (void) {
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r=db_env_create(&env, 0); assert(r==0); r=db_env_create(&env, 0); assert(r==0);
env->set_errfile(env, stderr); env->set_errfile(env, stderr);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=db->set_flags(db, DB_DUPSORT); r=db->set_flags(db, DB_DUPSORT);
r=env->txn_begin(env, 0, &txn, 0); assert(r==0); r=env->txn_begin(env, 0, &txn, 0); assert(r==0);
r=db->open(db, txn, "foo.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=db->open(db, txn, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
insert(0, 0); insert(0, 0);
insert(0, 1); insert(0, 1);
r=txn->commit(txn, 0); assert(r==0); r=txn->commit(txn, 0); assert(r==0);
......
...@@ -73,16 +73,16 @@ static void ...@@ -73,16 +73,16 @@ static void
test_abort3 (void) { test_abort3 (void) {
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r=db_env_create(&env, 0); assert(r==0); r=db_env_create(&env, 0); assert(r==0);
env->set_errfile(env, stderr); env->set_errfile(env, stderr);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=db->set_flags(db, DB_DUPSORT); r=db->set_flags(db, DB_DUPSORT);
r=env->txn_begin(env, 0, &txn, 0); assert(r==0); r=env->txn_begin(env, 0, &txn, 0); assert(r==0);
r=db->open(db, txn, "foo.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=db->open(db, txn, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
insert(0, 0); insert(0, 0);
insert(0, 1); insert(0, 1);
r=txn->commit(txn, 0); assert(r==0); r=txn->commit(txn, 0); assert(r==0);
...@@ -99,7 +99,7 @@ test_abort3 (void) { ...@@ -99,7 +99,7 @@ test_abort3 (void) {
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=db->set_flags(db, DB_DUPSORT); r=db->set_flags(db, DB_DUPSORT);
r=env->txn_begin(env, 0, &txn, 0); assert(r==0); r=env->txn_begin(env, 0, &txn, 0); assert(r==0);
r=db->open(db, txn, "foo.db", 0, DB_BTREE, 0, 0777); CKERR(r); r=db->open(db, txn, "foo.db", 0, DB_BTREE, 0, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
lookup(0, 0, 1); lookup(0, 0, 1);
r=txn->commit(txn, 0); CKERR(r); r=txn->commit(txn, 0); CKERR(r);
r=db->close(db, 0); CKERR(r); r=db->close(db, 0); CKERR(r);
......
...@@ -102,7 +102,7 @@ int main(int argc, const char *argv[]) { ...@@ -102,7 +102,7 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv); parse_args(argc, argv);
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
// test_dupsort_delete(256); return 0; // test_dupsort_delete(256); return 0;
/* nodup tests */ /* nodup tests */
......
...@@ -124,7 +124,7 @@ int main(int argc, const char *argv[]) { ...@@ -124,7 +124,7 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv); parse_args(argc, argv);
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
int limit = 1<<13; int limit = 1<<13;
if (verbose > 1) if (verbose > 1)
......
...@@ -149,7 +149,7 @@ int main(int argc, const char *argv[]) { ...@@ -149,7 +149,7 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv); parse_args(argc, argv);
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
int limit = 1<<13; int limit = 1<<13;
if (verbose > 1) if (verbose > 1)
......
...@@ -155,7 +155,7 @@ int main(int argc, const char *argv[]) { ...@@ -155,7 +155,7 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv); parse_args(argc, argv);
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
int limit = 1<<13; int limit = 1<<13;
if (verbose > 1) if (verbose > 1)
......
...@@ -150,7 +150,7 @@ int main(int argc, const char *argv[]) { ...@@ -150,7 +150,7 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv); parse_args(argc, argv);
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
int limit = 1<<13; int limit = 1<<13;
if (verbose > 1) if (verbose > 1)
......
...@@ -157,7 +157,7 @@ int main(int argc, const char *argv[]) { ...@@ -157,7 +157,7 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv); parse_args(argc, argv);
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
int limit = 1<<13; int limit = 1<<13;
if (verbose > 1) if (verbose > 1)
......
...@@ -18,12 +18,12 @@ int main (int argc __attribute__((__unused__)), char *argv[] __attribute__((__u ...@@ -18,12 +18,12 @@ int main (int argc __attribute__((__unused__)), char *argv[] __attribute__((__u
DB_ENV *env; DB_ENV *env;
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r=db_env_create(&env, 0); assert(r==0); r=db_env_create(&env, 0); assert(r==0);
env->set_errfile(env,0); // Turn off those annoying errors env->set_errfile(env,0); // Turn off those annoying errors
r=env->close (env, 0); assert(r==0); r=env->close (env, 0); assert(r==0);
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r=db_env_create(&env, 0); assert(r==0); r=db_env_create(&env, 0); assert(r==0);
env->set_errfile(env,0); // Turn off those annoying errors env->set_errfile(env,0); // Turn off those annoying errors
r=env->close (env, 1); r=env->close (env, 1);
...@@ -34,19 +34,19 @@ int main (int argc __attribute__((__unused__)), char *argv[] __attribute__((__u ...@@ -34,19 +34,19 @@ int main (int argc __attribute__((__unused__)), char *argv[] __attribute__((__u
assert(r==0); assert(r==0);
#endif #endif
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r=db_env_create(&env, 0); assert(r==0); r=db_env_create(&env, 0); assert(r==0);
env->set_errfile(env,0); // Turn off those annoying errors env->set_errfile(env,0); // Turn off those annoying errors
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_PRIVATE|DB_CREATE, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_PRIVATE|DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=env->close (env, 0); assert(r==0); r=env->close (env, 0); assert(r==0);
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r=db_env_create(&env, 0); assert(r==0); r=db_env_create(&env, 0); assert(r==0);
env->set_errfile(env,0); // Turn off those annoying errors env->set_errfile(env,0); // Turn off those annoying errors
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_PRIVATE|DB_CREATE, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_PRIVATE|DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=env->close (env, 1); r=env->close (env, 1);
//BDB does not check this. //BDB does not check this.
#if defined(USE_TDB) || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 3) #if defined(USE_TDB) || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 3)
......
...@@ -36,7 +36,7 @@ int main(int argc, const char *argv[]) { ...@@ -36,7 +36,7 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv); parse_args(argc, argv);
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
#ifdef USE_TDB #ifdef USE_TDB
toku_set_trace_file(ENVDIR "/trace.tktrace"); toku_set_trace_file(ENVDIR "/trace.tktrace");
......
...@@ -21,7 +21,7 @@ int main (int argc, const char *argv[]) { ...@@ -21,7 +21,7 @@ int main (int argc, const char *argv[]) {
#else #else
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
int r=mkdir(ENVDIR, 0777); assert(r==0); int r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
{ {
DB_ENV *env; DB_ENV *env;
......
...@@ -168,7 +168,7 @@ int main(int argc, const char *argv[]) { ...@@ -168,7 +168,7 @@ int main(int argc, const char *argv[]) {
snprintf(rmcmd, sizeof(rmcmd), "rm -rf %s", annotated_envdir); snprintf(rmcmd, sizeof(rmcmd), "rm -rf %s", annotated_envdir);
system(rmcmd); system(rmcmd);
} }
mkdir(annotated_envdir, 0777); toku_os_mkdir(annotated_envdir, S_IRWXU+S_IRWXG+S_IRWXO);
if (doi==0) { if (doi==0) {
for (i=1; i <= 256; i *= 2) { for (i=1; i <= 256; i *= 2) {
......
...@@ -34,7 +34,7 @@ test_get (int dup_mode) { ...@@ -34,7 +34,7 @@ test_get (int dup_mode) {
int main (int argc, const char *argv[]) { int main (int argc, const char *argv[]) {
parse_args(argc, argv); parse_args(argc, argv);
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
test_get(0); test_get(0);
test_get(DB_DUP + DB_DUPSORT); test_get(DB_DUP + DB_DUPSORT);
......
...@@ -39,10 +39,10 @@ test_groupcommit (int nthreads) { ...@@ -39,10 +39,10 @@ test_groupcommit (int nthreads) {
DB_TXN *tid; DB_TXN *tid;
r=db_env_create(&env, 0); assert(r==0); r=db_env_create(&env, 0); assert(r==0);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE|DB_THREAD, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE|DB_THREAD, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=env->txn_begin(env, 0, &tid, 0); assert(r==0); r=env->txn_begin(env, 0, &tid, 0); assert(r==0);
r=db->open(db, tid, "foo.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=db->open(db, tid, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=tid->commit(tid, 0); assert(r==0); r=tid->commit(tid, 0); assert(r==0);
int i; int i;
...@@ -108,7 +108,7 @@ int main (int argc, const char *argv[]) { ...@@ -108,7 +108,7 @@ int main (int argc, const char *argv[]) {
{ int r = db_env_set_func_fsync(do_fsync); CKERR(r); } { int r = db_env_set_func_fsync(do_fsync); CKERR(r); }
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
{ int r=mkdir(ENVDIR, 0777); assert(r==0); } { int r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0); }
test_groupcommit(1); printtdiff("1 thread"); test_groupcommit(1); printtdiff("1 thread");
test_groupcommit(2); printtdiff("2 threads"); test_groupcommit(2); printtdiff("2 threads");
......
...@@ -39,10 +39,10 @@ test_groupcommit (int nthreads) { ...@@ -39,10 +39,10 @@ test_groupcommit (int nthreads) {
DB_TXN *tid; DB_TXN *tid;
r=db_env_create(&env, 0); assert(r==0); r=db_env_create(&env, 0); assert(r==0);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE|DB_THREAD, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE|DB_THREAD, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=env->txn_begin(env, 0, &tid, 0); assert(r==0); r=env->txn_begin(env, 0, &tid, 0); assert(r==0);
r=db->open(db, tid, "foo.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=db->open(db, tid, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=tid->commit(tid, 0); assert(r==0); r=tid->commit(tid, 0); assert(r==0);
int i; int i;
...@@ -97,7 +97,7 @@ int main (int argc, const char *argv[]) { ...@@ -97,7 +97,7 @@ int main (int argc, const char *argv[]) {
parse_args(argc, argv); parse_args(argc, argv);
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
{ int r=mkdir(ENVDIR, 0777); assert(r==0); } { int r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0); }
gettimeofday(&prevtime, 0); gettimeofday(&prevtime, 0);
test_groupcommit(1); printtdiff("1 thread"); test_groupcommit(1); printtdiff("1 thread");
......
...@@ -49,7 +49,7 @@ test_hsoc (int pagesize, int dup_mode) { ...@@ -49,7 +49,7 @@ test_hsoc (int pagesize, int dup_mode) {
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
/* create the dup database file */ /* create the dup database file */
r = db_create(&db, null_env, 0); assert(r == 0); r = db_create(&db, null_env, 0); assert(r == 0);
......
...@@ -68,7 +68,7 @@ int main(int argc, const char *argv[]) { ...@@ -68,7 +68,7 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv); parse_args(argc, argv);
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
test_insert_delete_insert(0); test_insert_delete_insert(0);
test_insert_delete_insert(DB_DUP + DB_DUPSORT); test_insert_delete_insert(DB_DUP + DB_DUPSORT);
......
...@@ -48,7 +48,7 @@ int main(int argc, const char *argv[]) { ...@@ -48,7 +48,7 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv); parse_args(argc, argv);
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
int r=mkdir(ENVDIR, 0777); assert(r==0); int r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
test_insert(256, 0); test_insert(256, 0);
......
...@@ -26,7 +26,7 @@ test_key_size_limit (int dup_mode) { ...@@ -26,7 +26,7 @@ test_key_size_limit (int dup_mode) {
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
/* create the dup database file */ /* create the dup database file */
r = db_create(&db, null_env, 0); r = db_create(&db, null_env, 0);
...@@ -82,7 +82,7 @@ test_data_size_limit (int dup_mode) { ...@@ -82,7 +82,7 @@ test_data_size_limit (int dup_mode) {
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
/* create the dup database file */ /* create the dup database file */
r = db_create(&db, null_env, 0); r = db_create(&db, null_env, 0);
......
...@@ -18,9 +18,9 @@ DB_ENV *env; ...@@ -18,9 +18,9 @@ DB_ENV *env;
int main (int UU(argc), char UU(*argv[])) { int main (int UU(argc), char UU(*argv[])) {
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r=db_env_create(&env, 0); assert(r==0); r=db_env_create(&env, 0); assert(r==0);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_PRIVATE|DB_CREATE, 0777); assert(r==0); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_PRIVATE|DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r=env->close(env, 0); assert(r==0); r=env->close(env, 0); assert(r==0);
return 0; return 0;
} }
...@@ -23,12 +23,12 @@ DB_TXN *tid; ...@@ -23,12 +23,12 @@ DB_TXN *tid;
int main (int UU(argc), char UU(*argv[])) { int main (int UU(argc), char UU(*argv[])) {
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r=db_env_create(&env, 0); assert(r==0); r=db_env_create(&env, 0); assert(r==0);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_PRIVATE|DB_CREATE, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_PRIVATE|DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=env->txn_begin(env, 0, &tid, 0); assert(r==0); r=env->txn_begin(env, 0, &tid, 0); assert(r==0);
r=db->open(db, tid, "foo.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=db->open(db, tid, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
{ {
DBT key,data; DBT key,data;
memset(&key, 0, sizeof(key)); memset(&key, 0, sizeof(key));
......
...@@ -35,10 +35,10 @@ static void insert_some (int outeri) { ...@@ -35,10 +35,10 @@ static void insert_some (int outeri) {
DB_TXN *tid; DB_TXN *tid;
r=db_env_create(&env, 0); assert(r==0); r=db_env_create(&env, 0); assert(r==0);
r=env->set_lk_max_locks(env, 2*maxcount); CKERR(r); r=env->set_lk_max_locks(env, 2*maxcount); CKERR(r);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE|create_flag, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE|create_flag, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=env->txn_begin(env, 0, &tid, 0); assert(r==0); r=env->txn_begin(env, 0, &tid, 0); assert(r==0);
r=db->open(db, tid, "foo.db", 0, DB_BTREE, create_flag, 0777); CKERR(r); r=db->open(db, tid, "foo.db", 0, DB_BTREE, create_flag, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=tid->commit(tid, 0); assert(r==0); r=tid->commit(tid, 0); assert(r==0);
r=env->txn_begin(env, 0, &tid, 0); assert(r==0); r=env->txn_begin(env, 0, &tid, 0); assert(r==0);
...@@ -80,13 +80,13 @@ static void make_db (void) { ...@@ -80,13 +80,13 @@ static void make_db (void) {
int i; int i;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r=db_env_create(&env, 0); assert(r==0); r=db_env_create(&env, 0); assert(r==0);
r=env->set_lk_max_locks(env, 2*maxcount); CKERR(r); r=env->set_lk_max_locks(env, 2*maxcount); CKERR(r);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=env->txn_begin(env, 0, &tid, 0); assert(r==0); r=env->txn_begin(env, 0, &tid, 0); assert(r==0);
r=db->open(db, tid, "foo.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=db->open(db, tid, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=tid->commit(tid, 0); assert(r==0); r=tid->commit(tid, 0); assert(r==0);
r=db->close(db, 0); CKERR(r); r=db->close(db, 0); CKERR(r);
r=env->close(env, 0); CKERR(r); r=env->close(env, 0); CKERR(r);
......
...@@ -24,12 +24,12 @@ DB_TXN *tid; ...@@ -24,12 +24,12 @@ DB_TXN *tid;
int main (int UU(argc), char UU(*argv[])) { int main (int UU(argc), char UU(*argv[])) {
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r=db_env_create(&env, 0); assert(r==0); r=db_env_create(&env, 0); assert(r==0);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_PRIVATE|DB_CREATE, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_PRIVATE|DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=env->txn_begin(env, 0, &tid, 0); assert(r==0); r=env->txn_begin(env, 0, &tid, 0); assert(r==0);
r=db->open(db, tid, "foo.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=db->open(db, tid, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
{ {
DBT key,data; DBT key,data;
memset(&key, 0, sizeof(key)); memset(&key, 0, sizeof(key));
......
...@@ -22,13 +22,13 @@ static void make_db (void) { ...@@ -22,13 +22,13 @@ static void make_db (void) {
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r=db_env_create(&env, 0); assert(r==0); r=db_env_create(&env, 0); assert(r==0);
env->set_errfile(env, stderr); env->set_errfile(env, stderr);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=env->txn_begin(env, 0, &tid, 0); assert(r==0); r=env->txn_begin(env, 0, &tid, 0); assert(r==0);
r=db->open(db, tid, "foo.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=db->open(db, tid, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=tid->commit(tid, 0); assert(r==0); r=tid->commit(tid, 0); assert(r==0);
r=db->close(db, 0); assert(r==0); r=db->close(db, 0); assert(r==0);
r=env->close(env, 0); assert(r==0); r=env->close(env, 0); assert(r==0);
......
...@@ -22,13 +22,13 @@ static void make_db (void) { ...@@ -22,13 +22,13 @@ static void make_db (void) {
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r=db_env_create(&env, 0); assert(r==0); r=db_env_create(&env, 0); assert(r==0);
env->set_errfile(env, stderr); env->set_errfile(env, stderr);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=env->txn_begin(env, 0, &tid, 0); assert(r==0); r=env->txn_begin(env, 0, &tid, 0); assert(r==0);
r=db->open(db, tid, "foo.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=db->open(db, tid, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=tid->commit(tid, 0); assert(r==0); r=tid->commit(tid, 0); assert(r==0);
r=db->close(db, 0); assert(r==0); r=db->close(db, 0); assert(r==0);
r=env->close(env, 0); assert(r==0); r=env->close(env, 0); assert(r==0);
......
...@@ -23,12 +23,12 @@ static void make_db (void) { ...@@ -23,12 +23,12 @@ static void make_db (void) {
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r=db_env_create(&env, 0); assert(r==0); r=db_env_create(&env, 0); assert(r==0);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=env->txn_begin(env, 0, &tid, 0); assert(r==0); r=env->txn_begin(env, 0, &tid, 0); assert(r==0);
r=db->open(db, tid, "foo.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=db->open(db, tid, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=tid->commit(tid, 0); assert(r==0); r=tid->commit(tid, 0); assert(r==0);
r=env->txn_begin(env, 0, &tid, 0); assert(r==0); r=env->txn_begin(env, 0, &tid, 0); assert(r==0);
{ {
......
...@@ -22,12 +22,12 @@ static void make_db (void) { ...@@ -22,12 +22,12 @@ static void make_db (void) {
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r=db_env_create(&env, 0); assert(r==0); r=db_env_create(&env, 0); assert(r==0);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=env->txn_begin(env, 0, &tid, 0); assert(r==0); r=env->txn_begin(env, 0, &tid, 0); assert(r==0);
r=db->open(db, tid, "foo.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=db->open(db, tid, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=tid->commit(tid, 0); assert(r==0); r=tid->commit(tid, 0); assert(r==0);
r=env->txn_begin(env, 0, &tid, 0); assert(r==0); r=env->txn_begin(env, 0, &tid, 0); assert(r==0);
{ {
......
...@@ -24,13 +24,13 @@ static void make_db (void) { ...@@ -24,13 +24,13 @@ static void make_db (void) {
int i; int i;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r=db_env_create(&env, 0); assert(r==0); r=db_env_create(&env, 0); assert(r==0);
r=env->set_lk_max_locks(env, 30000); CKERR(r); r=env->set_lk_max_locks(env, 30000); CKERR(r);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=env->txn_begin(env, 0, &tid, 0); assert(r==0); r=env->txn_begin(env, 0, &tid, 0); assert(r==0);
r=db->open(db, tid, "foo.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=db->open(db, tid, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=tid->commit(tid, 0); assert(r==0); r=tid->commit(tid, 0); assert(r==0);
r=env->txn_begin(env, 0, &tid, 0); assert(r==0); r=env->txn_begin(env, 0, &tid, 0); assert(r==0);
......
...@@ -26,13 +26,13 @@ static void make_db (void) { ...@@ -26,13 +26,13 @@ static void make_db (void) {
int i; int i;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r=db_env_create(&env, 0); assert(r==0); r=db_env_create(&env, 0); assert(r==0);
r=env->set_lk_max_locks(env, 30000); CKERR(r); r=env->set_lk_max_locks(env, 30000); CKERR(r);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=env->txn_begin(env, 0, &tid, 0); assert(r==0); r=env->txn_begin(env, 0, &tid, 0); assert(r==0);
r=db->open(db, tid, "foo.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=db->open(db, tid, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=tid->commit(tid, 0); assert(r==0); r=tid->commit(tid, 0); assert(r==0);
r=env->txn_begin(env, 0, &tid, 0); assert(r==0); r=env->txn_begin(env, 0, &tid, 0); assert(r==0);
......
...@@ -33,13 +33,13 @@ static void make_db (void) { ...@@ -33,13 +33,13 @@ static void make_db (void) {
int maxcount = 24073; int maxcount = 24073;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r=db_env_create(&env, 0); assert(r==0); r=db_env_create(&env, 0); assert(r==0);
r=env->set_lk_max_locks(env, 2*maxcount); CKERR(r); r=env->set_lk_max_locks(env, 2*maxcount); CKERR(r);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=env->txn_begin(env, 0, &tid, 0); assert(r==0); r=env->txn_begin(env, 0, &tid, 0); assert(r==0);
r=db->open(db, tid, "foo.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=db->open(db, tid, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=tid->commit(tid, 0); assert(r==0); r=tid->commit(tid, 0); assert(r==0);
r=env->txn_begin(env, 0, &tid, 0); assert(r==0); r=env->txn_begin(env, 0, &tid, 0); assert(r==0);
......
...@@ -32,13 +32,13 @@ static void make_db (void) { ...@@ -32,13 +32,13 @@ static void make_db (void) {
int maxcount = 24073; int maxcount = 24073;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r=db_env_create(&env, 0); assert(r==0); r=db_env_create(&env, 0); assert(r==0);
r=env->set_lk_max_locks(env, 2*maxcount); CKERR(r); r=env->set_lk_max_locks(env, 2*maxcount); CKERR(r);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=env->txn_begin(env, 0, &tid, 0); assert(r==0); r=env->txn_begin(env, 0, &tid, 0); assert(r==0);
r=db->open(db, tid, "foo.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=db->open(db, tid, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=tid->commit(tid, 0); assert(r==0); r=tid->commit(tid, 0); assert(r==0);
r=env->txn_begin(env, 0, &tid, 0); assert(r==0); r=env->txn_begin(env, 0, &tid, 0); assert(r==0);
......
...@@ -78,12 +78,12 @@ static void make_db (void) { ...@@ -78,12 +78,12 @@ static void make_db (void) {
int i; int i;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r=db_env_create(&env, 0); assert(r==0); r=db_env_create(&env, 0); assert(r==0);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=env->txn_begin(env, 0, &tid, 0); assert(r==0); r=env->txn_begin(env, 0, &tid, 0); assert(r==0);
r=db->open(db, tid, "foo.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=db->open(db, tid, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=tid->commit(tid, 0); assert(r==0); r=tid->commit(tid, 0); assert(r==0);
r=env->txn_begin(env, 0, &tid, 0); assert(r==0); r=env->txn_begin(env, 0, &tid, 0); assert(r==0);
......
...@@ -77,12 +77,12 @@ static void make_db (void) { ...@@ -77,12 +77,12 @@ static void make_db (void) {
int i; int i;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r=db_env_create(&env, 0); assert(r==0); r=db_env_create(&env, 0); assert(r==0);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=env->txn_begin(env, 0, &tid, 0); assert(r==0); r=env->txn_begin(env, 0, &tid, 0); assert(r==0);
r=db->open(db, tid, "foo.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=db->open(db, tid, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=tid->commit(tid, 0); assert(r==0); r=tid->commit(tid, 0); assert(r==0);
r=env->txn_begin(env, 0, &tid, 0); assert(r==0); r=env->txn_begin(env, 0, &tid, 0); assert(r==0);
......
...@@ -246,19 +246,19 @@ static void make_db (void) { ...@@ -246,19 +246,19 @@ static void make_db (void) {
int i; int i;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r=db_env_create(&env, 0); assert(r==0); r=db_env_create(&env, 0); assert(r==0);
env->set_errfile(env, stderr); env->set_errfile(env, stderr);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=db_create(&pending_i, env, 0); CKERR(r); r=db_create(&pending_i, env, 0); CKERR(r);
r=db_create(&pending_d, env, 0); CKERR(r); r=db_create(&pending_d, env, 0); CKERR(r);
r=db_create(&committed, env, 0); CKERR(r); r=db_create(&committed, env, 0); CKERR(r);
r=env->txn_begin(env, 0, &tid, 0); assert(r==0); r=env->txn_begin(env, 0, &tid, 0); assert(r==0);
r=db->open(db, tid, "foo.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=db->open(db, tid, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=pending_i->open(pending_i, tid, "pending_i.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=pending_i->open(pending_i, tid, "pending_i.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=pending_d->open(pending_d, tid, "pending_d.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=pending_d->open(pending_d, tid, "pending_d.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=committed->open(committed, tid, "committed.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=committed->open(committed, tid, "committed.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=tid->commit(tid, 0); assert(r==0); r=tid->commit(tid, 0); assert(r==0);
r=env->txn_begin(env, 0, &tid, 0); assert(r==0); r=env->txn_begin(env, 0, &tid, 0); assert(r==0);
r=env->txn_begin(env, 0, &bookx, 0); assert(r==0); r=env->txn_begin(env, 0, &bookx, 0); assert(r==0);
......
...@@ -34,15 +34,15 @@ static void make_db (void) { ...@@ -34,15 +34,15 @@ static void make_db (void) {
int maxcount = 100000; int maxcount = 100000;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r=db_env_create(&env, 0); assert(r==0); r=db_env_create(&env, 0); assert(r==0);
#ifdef TOKUDB #ifdef TOKUDB
r=env->set_lk_max_locks(env, 2*maxcount); CKERR(r); r=env->set_lk_max_locks(env, 2*maxcount); CKERR(r);
#endif #endif
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=env->txn_begin(env, 0, &tid, 0); assert(r==0); r=env->txn_begin(env, 0, &tid, 0); assert(r==0);
r=db->open(db, tid, "foo.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=db->open(db, tid, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=tid->commit(tid, 0); assert(r==0); r=tid->commit(tid, 0); assert(r==0);
r=env->txn_begin(env, 0, &tid, 0); assert(r==0); r=env->txn_begin(env, 0, &tid, 0); assert(r==0);
......
...@@ -34,10 +34,10 @@ static void insert_some (int outeri) { ...@@ -34,10 +34,10 @@ static void insert_some (int outeri) {
DB_TXN *tid; DB_TXN *tid;
r=db_env_create(&env, 0); assert(r==0); r=db_env_create(&env, 0); assert(r==0);
r=env->set_lk_max_locks(env, 2*maxcount); CKERR(r); r=env->set_lk_max_locks(env, 2*maxcount); CKERR(r);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE|create_flag, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE|create_flag, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=env->txn_begin(env, 0, &tid, 0); assert(r==0); r=env->txn_begin(env, 0, &tid, 0); assert(r==0);
r=db->open(db, tid, "foo.db", 0, DB_BTREE, create_flag, 0777); CKERR(r); r=db->open(db, tid, "foo.db", 0, DB_BTREE, create_flag, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=tid->commit(tid, 0); assert(r==0); r=tid->commit(tid, 0); assert(r==0);
r=env->txn_begin(env, 0, &tid, 0); assert(r==0); r=env->txn_begin(env, 0, &tid, 0); assert(r==0);
...@@ -72,13 +72,13 @@ static void make_db (void) { ...@@ -72,13 +72,13 @@ static void make_db (void) {
int i; int i;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r=db_env_create(&env, 0); assert(r==0); r=db_env_create(&env, 0); assert(r==0);
r=env->set_lk_max_locks(env, 2*maxcount); CKERR(r); r=env->set_lk_max_locks(env, 2*maxcount); CKERR(r);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=env->txn_begin(env, 0, &tid, 0); assert(r==0); r=env->txn_begin(env, 0, &tid, 0); assert(r==0);
r=db->open(db, tid, "foo.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=db->open(db, tid, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=tid->commit(tid, 0); assert(r==0); r=tid->commit(tid, 0); assert(r==0);
r=db->close(db, 0); CKERR(r); r=db->close(db, 0); CKERR(r);
r=env->close(env, 0); CKERR(r); r=env->close(env, 0); CKERR(r);
......
...@@ -34,10 +34,10 @@ static void insert_some (int outeri) { ...@@ -34,10 +34,10 @@ static void insert_some (int outeri) {
DB_TXN *tid; DB_TXN *tid;
r=db_env_create(&env, 0); assert(r==0); r=db_env_create(&env, 0); assert(r==0);
r=env->set_lk_max_locks(env, 2*maxcount); CKERR(r); r=env->set_lk_max_locks(env, 2*maxcount); CKERR(r);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE|create_flag, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE|create_flag, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=env->txn_begin(env, 0, &tid, 0); assert(r==0); r=env->txn_begin(env, 0, &tid, 0); assert(r==0);
r=db->open(db, tid, "foo.db", 0, DB_BTREE, create_flag, 0777); CKERR(r); r=db->open(db, tid, "foo.db", 0, DB_BTREE, create_flag, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=tid->commit(tid, 0); assert(r==0); r=tid->commit(tid, 0); assert(r==0);
r=env->txn_begin(env, 0, &tid, 0); assert(r==0); r=env->txn_begin(env, 0, &tid, 0); assert(r==0);
...@@ -72,13 +72,13 @@ static void make_db (void) { ...@@ -72,13 +72,13 @@ static void make_db (void) {
int i; int i;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r=db_env_create(&env, 0); assert(r==0); r=db_env_create(&env, 0); assert(r==0);
r=env->set_lk_max_locks(env, 2*maxcount); CKERR(r); r=env->set_lk_max_locks(env, 2*maxcount); CKERR(r);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=env->txn_begin(env, 0, &tid, 0); assert(r==0); r=env->txn_begin(env, 0, &tid, 0); assert(r==0);
r=db->open(db, tid, "foo.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=db->open(db, tid, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=tid->commit(tid, 0); assert(r==0); r=tid->commit(tid, 0); assert(r==0);
r=db->close(db, 0); CKERR(r); r=db->close(db, 0); CKERR(r);
r=env->close(env, 0); CKERR(r); r=env->close(env, 0); CKERR(r);
......
...@@ -41,12 +41,12 @@ int main (int UU(argc), char UU(*argv[])) { ...@@ -41,12 +41,12 @@ int main (int UU(argc), char UU(*argv[])) {
DB_TXN *tid; DB_TXN *tid;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r=db_env_create(&env, 0); assert(r==0); r=db_env_create(&env, 0); assert(r==0);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=env->txn_begin(env, 0, &tid, 0); assert(r==0); r=env->txn_begin(env, 0, &tid, 0); assert(r==0);
r=db->open(db, tid, "foo.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=db->open(db, tid, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=tid->commit(tid, 0); assert(r==0); r=tid->commit(tid, 0); assert(r==0);
{ {
......
...@@ -40,13 +40,13 @@ test_logmax (int logmax) { ...@@ -40,13 +40,13 @@ test_logmax (int logmax) {
DB_TXN *tid; DB_TXN *tid;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r=db_env_create(&env, 0); assert(r==0); r=db_env_create(&env, 0); assert(r==0);
if (logmax>0) { if (logmax>0) {
r=env->set_lg_max(env, logmax); r=env->set_lg_max(env, logmax);
assert(r==0); assert(r==0);
} }
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
{ {
u_int32_t lmax; u_int32_t lmax;
r=env->get_lg_max(env, &lmax); r=env->get_lg_max(env, &lmax);
...@@ -60,7 +60,7 @@ test_logmax (int logmax) { ...@@ -60,7 +60,7 @@ test_logmax (int logmax) {
} }
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=env->txn_begin(env, 0, &tid, 0); assert(r==0); r=env->txn_begin(env, 0, &tid, 0); assert(r==0);
r=db->open(db, tid, "foo.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=db->open(db, tid, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=tid->commit(tid, 0); assert(r==0); r=tid->commit(tid, 0); assert(r==0);
int i; int i;
......
...@@ -12,7 +12,7 @@ seqinsert (int n, float p) { ...@@ -12,7 +12,7 @@ seqinsert (int n, float p) {
if (verbose) printf("%s %d %f\n", __FUNCTION__, n, p); if (verbose) printf("%s %d %f\n", __FUNCTION__, n, p);
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
int r; int r;
DB_ENV *env; DB_ENV *env;
...@@ -23,7 +23,7 @@ seqinsert (int n, float p) { ...@@ -23,7 +23,7 @@ seqinsert (int n, float p) {
DB *db; DB *db;
r = db_create(&db, env, 0); assert(r == 0); r = db_create(&db, env, 0); assert(r == 0);
r = db->open(db, 0, "test.db", 0, DB_BTREE, DB_CREATE, 0777); assert(r == 0); r = db->open(db, 0, "test.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
int i; int i;
for (i = 2; i <= 2*n; i += 2) { for (i = 2; i <= 2*n; i += 2) {
......
...@@ -57,15 +57,15 @@ static void ...@@ -57,15 +57,15 @@ static void
test_nested (void) { test_nested (void) {
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r=db_env_create(&env, 0); assert(r==0); r=db_env_create(&env, 0); assert(r==0);
env->set_errfile(env, stderr); env->set_errfile(env, stderr);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=env->txn_begin(env, 0, &txn, 0); assert(r==0); r=env->txn_begin(env, 0, &txn, 0); assert(r==0);
r=db->open(db, txn, "foo.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=db->open(db, txn, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
insert(0, txn); insert(0, txn);
insert(1, txn); insert(1, txn);
......
...@@ -158,7 +158,7 @@ int main(int argc, const char *argv[]) { ...@@ -158,7 +158,7 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv); parse_args(argc, argv);
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
for (i=1; i<65537; i *= 2) { for (i=1; i<65537; i *= 2) {
test_icdi_search(i, 0); test_icdi_search(i, 0);
......
...@@ -23,7 +23,7 @@ test_rand_insert (int n, int dup_mode) { ...@@ -23,7 +23,7 @@ test_rand_insert (int n, int dup_mode) {
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
/* create the dup database file */ /* create the dup database file */
r = db_create(&db, null_env, 0); r = db_create(&db, null_env, 0);
......
...@@ -66,7 +66,7 @@ test_reverse_compare (int n, int dup_flags) { ...@@ -66,7 +66,7 @@ test_reverse_compare (int n, int dup_flags) {
int i; int i;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
/* create the dup database file */ /* create the dup database file */
r = db_create(&db, null_env, 0); r = db_create(&db, null_env, 0);
......
...@@ -24,7 +24,7 @@ static void make_db (int n_locks) { ...@@ -24,7 +24,7 @@ static void make_db (int n_locks) {
int i; int i;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
r=mkdir(ENVDIR, 0777); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r=db_env_create(&env, 0); assert(r==0); r=db_env_create(&env, 0); assert(r==0);
env->set_errfile(env, 0); env->set_errfile(env, 0);
if (n_locks>0) { if (n_locks>0) {
...@@ -39,10 +39,10 @@ static void make_db (int n_locks) { ...@@ -39,10 +39,10 @@ static void make_db (int n_locks) {
r=env->get_lk_max_locks(env, &set_locks); r=env->get_lk_max_locks(env, &set_locks);
assert(r == 0 && set_locks == (u_int32_t)n_locks); assert(r == 0 && set_locks == (u_int32_t)n_locks);
} }
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, 0777); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
r=env->txn_begin(env, 0, &tid, 0); assert(r==0); r=env->txn_begin(env, 0, &tid, 0); assert(r==0);
r=db->open(db, tid, "foo.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r=db->open(db, tid, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=tid->commit(tid, 0); assert(r==0); r=tid->commit(tid, 0); assert(r==0);
#ifndef TOKUDB #ifndef TOKUDB
......
...@@ -47,7 +47,7 @@ test_db_create (void) { ...@@ -47,7 +47,7 @@ test_db_create (void) {
unlink(dbfile); unlink(dbfile);
r = db_create(&db, 0, 0); assert(r == 0); r = db_create(&db, 0, 0); assert(r == 0);
db->set_errfile(db,0); // Turn off those annoying errors db->set_errfile(db,0); // Turn off those annoying errors
r = db->open(db, 0, dbfile, dbname, DB_BTREE, DB_CREATE, 0777); assert(r == 0); r = db->open(db, 0, dbfile, dbname, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
r = db_put(db, htonl(1), 1); assert(r == 0); r = db_put(db, htonl(1), 1); assert(r == 0);
r = db_get(db, htonl(1), 1, 0); assert(r == 0); r = db_get(db, htonl(1), 1, 0); assert(r == 0);
r = db_get(db, htonl(1), 1, DB_DBT_USERMEM); assert(r == 0); r = db_get(db, htonl(1), 1, DB_DBT_USERMEM); assert(r == 0);
...@@ -62,7 +62,7 @@ test_db_thread (void) { ...@@ -62,7 +62,7 @@ test_db_thread (void) {
unlink(dbfile); unlink(dbfile);
r = db_create(&db, 0, 0); assert(r == 0); r = db_create(&db, 0, 0); assert(r == 0);
db->set_errfile(db,0); // Turn off those annoying errors db->set_errfile(db,0); // Turn off those annoying errors
r = db->open(db, 0, dbfile, dbname, DB_BTREE, DB_CREATE + DB_THREAD, 0777); assert(r == 0); r = db->open(db, 0, dbfile, dbname, DB_BTREE, DB_CREATE + DB_THREAD, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
r = db_put(db, htonl(1), 1); assert(r == 0); r = db_put(db, htonl(1), 1); assert(r == 0);
r = db_get(db, htonl(1), 1, 0); assert(r == EINVAL); r = db_get(db, htonl(1), 1, 0); assert(r == EINVAL);
r = db_get(db, htonl(1), 1, DB_DBT_MALLOC); assert(r == 0); r = db_get(db, htonl(1), 1, DB_DBT_MALLOC); assert(r == 0);
...@@ -74,7 +74,7 @@ test_db_thread (void) { ...@@ -74,7 +74,7 @@ test_db_thread (void) {
int main(int argc, const char *argv[]) { int main(int argc, const char *argv[]) {
parse_args(argc, argv); parse_args(argc, argv);
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
test_db_create(); test_db_create();
test_db_thread(); test_db_thread();
return 0; return 0;
......
...@@ -59,7 +59,7 @@ int main(int argc, char *argv[]) { ...@@ -59,7 +59,7 @@ int main(int argc, char *argv[]) {
my_t n = 1000000; my_t n = 1000000;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
int i; int i;
for (i=1; i<argc; i++) { for (i=1; i<argc; i++) {
...@@ -88,12 +88,12 @@ int main(int argc, char *argv[]) { ...@@ -88,12 +88,12 @@ int main(int argc, char *argv[]) {
r = db_env_create(&env, 0); assert(r == 0); r = db_env_create(&env, 0); assert(r == 0);
r = env->set_cachesize(env, 0, 128000000, 1); assert(r == 0); r = env->set_cachesize(env, 0, 128000000, 1); assert(r == 0);
r = env->open(env, ENVDIR, DB_CREATE + DB_THREAD + DB_PRIVATE + DB_INIT_MPOOL + DB_INIT_LOCK, 0777); assert(r == 0); r = env->open(env, ENVDIR, DB_CREATE + DB_THREAD + DB_PRIVATE + DB_INIT_MPOOL + DB_INIT_LOCK, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
DB *db; DB *db;
r = db_create(&db, env, 0); assert(r == 0); r = db_create(&db, env, 0); assert(r == 0);
r = db->open(db, 0, dbfile, dbname, DB_BTREE, DB_CREATE + DB_THREAD, 0777); assert(r == 0); r = db->open(db, 0, dbfile, dbname, DB_BTREE, DB_CREATE + DB_THREAD, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
struct db_inserter work[nthreads]; struct db_inserter work[nthreads];
......
...@@ -206,7 +206,7 @@ int main() { ...@@ -206,7 +206,7 @@ int main() {
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
second_setup(); second_setup();
insert_test(); insert_test();
......
...@@ -96,7 +96,7 @@ int main(int argc, char *argv[]) { ...@@ -96,7 +96,7 @@ int main(int argc, char *argv[]) {
if (!do_resume) { if (!do_resume) {
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
} }
int r; int r;
...@@ -104,12 +104,12 @@ int main(int argc, char *argv[]) { ...@@ -104,12 +104,12 @@ int main(int argc, char *argv[]) {
r = db_env_create(&env, 0); assert(r == 0); r = db_env_create(&env, 0); assert(r == 0);
r = env->set_cachesize(env, 0, 8000000, 1); assert(r == 0); r = env->set_cachesize(env, 0, 8000000, 1); assert(r == 0);
r = env->open(env, ENVDIR, DB_CREATE + DB_THREAD + DB_PRIVATE + DB_INIT_MPOOL + DB_INIT_LOCK, 0777); assert(r == 0); r = env->open(env, ENVDIR, DB_CREATE + DB_THREAD + DB_PRIVATE + DB_INIT_MPOOL + DB_INIT_LOCK, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
DB *db; DB *db;
r = db_create(&db, env, 0); assert(r == 0); r = db_create(&db, env, 0); assert(r == 0);
r = db->open(db, 0, dbfile, dbname, DB_BTREE, DB_CREATE + DB_THREAD, 0777); assert(r == 0); r = db->open(db, 0, dbfile, dbname, DB_BTREE, DB_CREATE + DB_THREAD, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
struct db_inserter work[nthreads]; struct db_inserter work[nthreads];
......
...@@ -19,13 +19,13 @@ test_truncate (int n) { ...@@ -19,13 +19,13 @@ test_truncate (int n) {
DBC *cursor; DBC *cursor;
r = db_env_create(&env, 0); assert(r == 0); r = db_env_create(&env, 0); assert(r == 0);
r = env->open(env, ENVDIR, DB_INIT_MPOOL + DB_PRIVATE + DB_CREATE, 0777); assert(r == 0); r = env->open(env, ENVDIR, DB_INIT_MPOOL + DB_PRIVATE + DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
int i; int i;
// populate the tree // populate the tree
r = db_create(&db, env, 0); assert(r == 0); r = db_create(&db, env, 0); assert(r == 0);
r = db->open(db, 0, "test.db", 0, DB_BTREE, DB_CREATE, 0777); assert(r == 0); r = db->open(db, 0, "test.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
for (i=0; i<n; i++) { for (i=0; i<n; i++) {
int k = htonl(i); int v = i; int k = htonl(i); int v = i;
...@@ -36,7 +36,7 @@ test_truncate (int n) { ...@@ -36,7 +36,7 @@ test_truncate (int n) {
r = db->close(db, 0); assert(r == 0); r = db->close(db, 0); assert(r == 0);
r = db_create(&db, env, 0); assert(r == 0); r = db_create(&db, env, 0); assert(r == 0);
r = db->open(db, 0, "test.db", 0, DB_UNKNOWN, 0, 0777); assert(r == 0); r = db->open(db, 0, "test.db", 0, DB_UNKNOWN, 0, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
// walk the tree - expect n rows // walk the tree - expect n rows
i = 0; i = 0;
...@@ -69,7 +69,7 @@ test_truncate (int n) { ...@@ -69,7 +69,7 @@ test_truncate (int n) {
r = db->close(db, 0); assert(r == 0); r = db->close(db, 0); assert(r == 0);
r = db_create(&db, env, 0); assert(r == 0); r = db_create(&db, env, 0); assert(r == 0);
r = db->open(db, 0, "test.db", 0, DB_UNKNOWN, 0, 0777); assert(r == 0); r = db->open(db, 0, "test.db", 0, DB_UNKNOWN, 0, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
// walk the tree - expect 0 rows // walk the tree - expect 0 rows
i = 0; i = 0;
...@@ -95,7 +95,7 @@ int main(int argc, const char *argv[]) { ...@@ -95,7 +95,7 @@ int main(int argc, const char *argv[]) {
int leafentry = 25; int leafentry = 25;
int n = (nodesize/leafentry) * 2; int n = (nodesize/leafentry) * 2;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
int r = test_truncate(n); int r = test_truncate(n);
return r; return r;
} }
...@@ -19,13 +19,13 @@ test_truncate_subdb (int n) { ...@@ -19,13 +19,13 @@ test_truncate_subdb (int n) {
DBC *cursor; DBC *cursor;
r = db_env_create(&env, 0); assert(r == 0); r = db_env_create(&env, 0); assert(r == 0);
r = env->open(env, ENVDIR, DB_INIT_MPOOL + DB_PRIVATE + DB_CREATE, 0777); assert(r == 0); r = env->open(env, ENVDIR, DB_INIT_MPOOL + DB_PRIVATE + DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
int i; int i;
// populate the tree // populate the tree
r = db_create(&db, env, 0); assert(r == 0); r = db_create(&db, env, 0); assert(r == 0);
r = db->open(db, 0, "test.db", "a", DB_BTREE, DB_CREATE, 0777); assert(r == 0); r = db->open(db, 0, "test.db", "a", DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
for (i=0; i<1; i++) { for (i=0; i<1; i++) {
int k = htonl(i); int v = i; int k = htonl(i); int v = i;
DBT key, val; DBT key, val;
...@@ -34,7 +34,7 @@ test_truncate_subdb (int n) { ...@@ -34,7 +34,7 @@ test_truncate_subdb (int n) {
r = db->close(db, 0); assert(r == 0); r = db->close(db, 0); assert(r == 0);
r = db_create(&db, env, 0); assert(r == 0); r = db_create(&db, env, 0); assert(r == 0);
r = db->open(db, 0, "test.db", "b", DB_BTREE, DB_CREATE, 0777); assert(r == 0); r = db->open(db, 0, "test.db", "b", DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
for (i=0; i<n; i++) { for (i=0; i<n; i++) {
int k = htonl(i); int v = i; int k = htonl(i); int v = i;
...@@ -45,7 +45,7 @@ test_truncate_subdb (int n) { ...@@ -45,7 +45,7 @@ test_truncate_subdb (int n) {
r = db->close(db, 0); assert(r == 0); r = db->close(db, 0); assert(r == 0);
r = db_create(&db, env, 0); assert(r == 0); r = db_create(&db, env, 0); assert(r == 0);
r = db->open(db, 0, "test.db", "b", DB_UNKNOWN, 0, 0777); assert(r == 0); r = db->open(db, 0, "test.db", "b", DB_UNKNOWN, 0, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
// walk the tree - expect n rows // walk the tree - expect n rows
i = 0; i = 0;
...@@ -78,7 +78,7 @@ test_truncate_subdb (int n) { ...@@ -78,7 +78,7 @@ test_truncate_subdb (int n) {
r = db->close(db, 0); assert(r == 0); r = db->close(db, 0); assert(r == 0);
r = db_create(&db, env, 0); assert(r == 0); r = db_create(&db, env, 0); assert(r == 0);
r = db->open(db, 0, "test.db", "b", DB_UNKNOWN, 0, 0777); assert(r == 0); r = db->open(db, 0, "test.db", "b", DB_UNKNOWN, 0, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
// walk the tree - expect 0 rows // walk the tree - expect 0 rows
i = 0; i = 0;
...@@ -104,7 +104,7 @@ int main(int argc, const char *argv[]) { ...@@ -104,7 +104,7 @@ int main(int argc, const char *argv[]) {
int leafentry = 25; int leafentry = 25;
int n = (nodesize/leafentry) * 2; int n = (nodesize/leafentry) * 2;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
int r = test_truncate_subdb(n); int r = test_truncate_subdb(n);
return r; return r;
} }
...@@ -19,13 +19,13 @@ test_truncate_txn_abort (int n) { ...@@ -19,13 +19,13 @@ test_truncate_txn_abort (int n) {
DBC *cursor; DBC *cursor;
r = db_env_create(&env, 0); assert(r == 0); r = db_env_create(&env, 0); assert(r == 0);
r = env->open(env, ENVDIR, DB_INIT_MPOOL + DB_INIT_LOCK + DB_INIT_TXN + DB_PRIVATE + DB_CREATE, 0777); assert(r == 0); r = env->open(env, ENVDIR, DB_INIT_MPOOL + DB_INIT_LOCK + DB_INIT_TXN + DB_PRIVATE + DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
int i; int i;
// populate the tree // populate the tree
r = db_create(&db, env, 0); assert(r == 0); r = db_create(&db, env, 0); assert(r == 0);
r = db->open(db, 0, "test.db", 0, DB_BTREE, DB_CREATE, 0777); assert(r == 0); r = db->open(db, 0, "test.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
for (i=0; i<n; i++) { for (i=0; i<n; i++) {
int k = htonl(i); int v = i; int k = htonl(i); int v = i;
...@@ -36,7 +36,7 @@ test_truncate_txn_abort (int n) { ...@@ -36,7 +36,7 @@ test_truncate_txn_abort (int n) {
r = db->close(db, 0); assert(r == 0); r = db->close(db, 0); assert(r == 0);
r = db_create(&db, env, 0); assert(r == 0); r = db_create(&db, env, 0); assert(r == 0);
r = db->open(db, 0, "test.db", 0, DB_UNKNOWN, DB_AUTO_COMMIT, 0777); assert(r == 0); r = db->open(db, 0, "test.db", 0, DB_UNKNOWN, DB_AUTO_COMMIT, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
DB_TXN *txn; DB_TXN *txn;
...@@ -83,7 +83,7 @@ test_truncate_txn_abort (int n) { ...@@ -83,7 +83,7 @@ test_truncate_txn_abort (int n) {
// walk the tree - expect n rows // walk the tree - expect n rows
r = db_create(&db, env, 0); assert(r == 0); r = db_create(&db, env, 0); assert(r == 0);
r = db->open(db, 0, "test.db", 0, DB_UNKNOWN, DB_AUTO_COMMIT, 0777); assert(r == 0); r = db->open(db, 0, "test.db", 0, DB_UNKNOWN, DB_AUTO_COMMIT, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
r = env->txn_begin(env, 0, &txn, 0); assert(r == 0); r = env->txn_begin(env, 0, &txn, 0); assert(r == 0);
...@@ -112,7 +112,7 @@ int main(int argc, const char *argv[]) { ...@@ -112,7 +112,7 @@ int main(int argc, const char *argv[]) {
int leafentry = 25; int leafentry = 25;
int n = (nodesize/leafentry) * 2; int n = (nodesize/leafentry) * 2;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
int r = test_truncate_txn_abort(n); int r = test_truncate_txn_abort(n);
return r; return r;
} }
...@@ -19,13 +19,13 @@ test_truncate_txn_commit (int n) { ...@@ -19,13 +19,13 @@ test_truncate_txn_commit (int n) {
DBC *cursor; DBC *cursor;
r = db_env_create(&env, 0); assert(r == 0); r = db_env_create(&env, 0); assert(r == 0);
r = env->open(env, ENVDIR, DB_INIT_MPOOL + DB_INIT_LOCK + DB_INIT_TXN + DB_PRIVATE + DB_CREATE, 0777); assert(r == 0); r = env->open(env, ENVDIR, DB_INIT_MPOOL + DB_INIT_LOCK + DB_INIT_TXN + DB_PRIVATE + DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
int i; int i;
// populate the tree // populate the tree
r = db_create(&db, env, 0); assert(r == 0); r = db_create(&db, env, 0); assert(r == 0);
r = db->open(db, 0, "test.db", 0, DB_BTREE, DB_CREATE, 0777); assert(r == 0); r = db->open(db, 0, "test.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
for (i=0; i<n; i++) { for (i=0; i<n; i++) {
int k = htonl(i); int v = i; int k = htonl(i); int v = i;
...@@ -36,7 +36,7 @@ test_truncate_txn_commit (int n) { ...@@ -36,7 +36,7 @@ test_truncate_txn_commit (int n) {
r = db->close(db, 0); assert(r == 0); r = db->close(db, 0); assert(r == 0);
r = db_create(&db, env, 0); assert(r == 0); r = db_create(&db, env, 0); assert(r == 0);
r = db->open(db, 0, "test.db", 0, DB_UNKNOWN, DB_AUTO_COMMIT, 0777); assert(r == 0); r = db->open(db, 0, "test.db", 0, DB_UNKNOWN, DB_AUTO_COMMIT, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
DB_TXN *txn; DB_TXN *txn;
...@@ -83,7 +83,7 @@ test_truncate_txn_commit (int n) { ...@@ -83,7 +83,7 @@ test_truncate_txn_commit (int n) {
// walk the tree - expect 0 rows // walk the tree - expect 0 rows
r = db_create(&db, env, 0); assert(r == 0); r = db_create(&db, env, 0); assert(r == 0);
r = db->open(db, 0, "test.db", 0, DB_UNKNOWN, DB_AUTO_COMMIT, 0777); assert(r == 0); r = db->open(db, 0, "test.db", 0, DB_UNKNOWN, DB_AUTO_COMMIT, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
r = env->txn_begin(env, 0, &txn, 0); assert(r == 0); r = env->txn_begin(env, 0, &txn, 0); assert(r == 0);
...@@ -112,7 +112,7 @@ int main(int argc, const char *argv[]) { ...@@ -112,7 +112,7 @@ int main(int argc, const char *argv[]) {
int leafentry = 25; int leafentry = 25;
int n = (nodesize/leafentry) * 2; int n = (nodesize/leafentry) * 2;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
int r = test_truncate_txn_commit(n); int r = test_truncate_txn_commit(n);
return r; return r;
} }
...@@ -20,13 +20,13 @@ test_truncate_txn_commit2 (int n) { ...@@ -20,13 +20,13 @@ test_truncate_txn_commit2 (int n) {
DBC *cursor; DBC *cursor;
r = db_env_create(&env, 0); assert(r == 0); r = db_env_create(&env, 0); assert(r == 0);
r = env->open(env, ENVDIR, DB_INIT_MPOOL + DB_INIT_LOCK + DB_INIT_TXN + DB_PRIVATE + DB_CREATE, 0777); assert(r == 0); r = env->open(env, ENVDIR, DB_INIT_MPOOL + DB_INIT_LOCK + DB_INIT_TXN + DB_PRIVATE + DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
int i; int i;
// populate the tree // populate the tree
r = db_create(&db, env, 0); assert(r == 0); r = db_create(&db, env, 0); assert(r == 0);
r = db->open(db, 0, "test.db", 0, DB_BTREE, DB_CREATE, 0777); assert(r == 0); r = db->open(db, 0, "test.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
for (i=0; i<n; i++) { for (i=0; i<n; i++) {
int k = htonl(i); int v = i; int k = htonl(i); int v = i;
...@@ -37,7 +37,7 @@ test_truncate_txn_commit2 (int n) { ...@@ -37,7 +37,7 @@ test_truncate_txn_commit2 (int n) {
r = db->close(db, 0); assert(r == 0); r = db->close(db, 0); assert(r == 0);
r = db_create(&db, env, 0); assert(r == 0); r = db_create(&db, env, 0); assert(r == 0);
r = db->open(db, 0, "test.db", 0, DB_UNKNOWN, DB_AUTO_COMMIT, 0777); assert(r == 0); r = db->open(db, 0, "test.db", 0, DB_UNKNOWN, DB_AUTO_COMMIT, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
DB_TXN *txn; DB_TXN *txn;
...@@ -91,7 +91,7 @@ test_truncate_txn_commit2 (int n) { ...@@ -91,7 +91,7 @@ test_truncate_txn_commit2 (int n) {
// walk the tree - expect 0 rows // walk the tree - expect 0 rows
r = db_create(&db, env, 0); assert(r == 0); r = db_create(&db, env, 0); assert(r == 0);
r = db->open(db, 0, "test.db", 0, DB_UNKNOWN, DB_AUTO_COMMIT, 0777); assert(r == 0); r = db->open(db, 0, "test.db", 0, DB_UNKNOWN, DB_AUTO_COMMIT, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
r = env->txn_begin(env, 0, &txn, 0); assert(r == 0); r = env->txn_begin(env, 0, &txn, 0); assert(r == 0);
...@@ -120,7 +120,7 @@ int main(int argc, const char *argv[]) { ...@@ -120,7 +120,7 @@ int main(int argc, const char *argv[]) {
int leafentry = 25; int leafentry = 25;
int n = (nodesize/leafentry) * 2; int n = (nodesize/leafentry) * 2;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
int r = test_truncate_txn_commit2(n); int r = test_truncate_txn_commit2(n);
return r; return r;
} }
...@@ -20,13 +20,13 @@ test_truncate_txn_commit2 (int n) { ...@@ -20,13 +20,13 @@ test_truncate_txn_commit2 (int n) {
DBC *cursor; DBC *cursor;
r = db_env_create(&env, 0); assert(r == 0); r = db_env_create(&env, 0); assert(r == 0);
r = env->open(env, ENVDIR, DB_INIT_MPOOL + DB_INIT_LOCK + DB_INIT_TXN + DB_PRIVATE + DB_CREATE, 0777); assert(r == 0); r = env->open(env, ENVDIR, DB_INIT_MPOOL + DB_INIT_LOCK + DB_INIT_TXN + DB_PRIVATE + DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
int i; int i;
// populate the tree // populate the tree
r = db_create(&db, env, 0); assert(r == 0); r = db_create(&db, env, 0); assert(r == 0);
r = db->open(db, 0, "test.db", 0, DB_BTREE, DB_CREATE, 0777); assert(r == 0); r = db->open(db, 0, "test.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
for (i=0; i<n; i++) { for (i=0; i<n; i++) {
int k = htonl(i); int v = i; int k = htonl(i); int v = i;
...@@ -37,7 +37,7 @@ test_truncate_txn_commit2 (int n) { ...@@ -37,7 +37,7 @@ test_truncate_txn_commit2 (int n) {
r = db->close(db, 0); assert(r == 0); r = db->close(db, 0); assert(r == 0);
r = db_create(&db, env, 0); assert(r == 0); r = db_create(&db, env, 0); assert(r == 0);
r = db->open(db, 0, "test.db", 0, DB_UNKNOWN, DB_AUTO_COMMIT, 0777); assert(r == 0); r = db->open(db, 0, "test.db", 0, DB_UNKNOWN, DB_AUTO_COMMIT, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
DB_TXN *txn; DB_TXN *txn;
...@@ -91,7 +91,7 @@ test_truncate_txn_commit2 (int n) { ...@@ -91,7 +91,7 @@ test_truncate_txn_commit2 (int n) {
// walk the tree - expect 0 rows // walk the tree - expect 0 rows
r = db_create(&db, env, 0); assert(r == 0); r = db_create(&db, env, 0); assert(r == 0);
r = db->open(db, 0, "test.db", 0, DB_UNKNOWN, DB_AUTO_COMMIT, 0777); assert(r == 0); r = db->open(db, 0, "test.db", 0, DB_UNKNOWN, DB_AUTO_COMMIT, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
r = env->txn_begin(env, 0, &txn, 0); assert(r == 0); r = env->txn_begin(env, 0, &txn, 0); assert(r == 0);
...@@ -120,7 +120,7 @@ int main(int argc, const char *argv[]) { ...@@ -120,7 +120,7 @@ int main(int argc, const char *argv[]) {
int leafentry = 25; int leafentry = 25;
int n = (nodesize/leafentry) * 2; int n = (nodesize/leafentry) * 2;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
int r = test_truncate_txn_commit2(n); int r = test_truncate_txn_commit2(n);
return r; return r;
} }
...@@ -32,13 +32,13 @@ test_truncate_with_cursors (int n) { ...@@ -32,13 +32,13 @@ test_truncate_with_cursors (int n) {
DBC *cursor; DBC *cursor;
r = db_env_create(&env, 0); assert(r == 0); r = db_env_create(&env, 0); assert(r == 0);
r = env->open(env, ENVDIR, DB_INIT_MPOOL + DB_PRIVATE + DB_CREATE, 0777); assert(r == 0); r = env->open(env, ENVDIR, DB_INIT_MPOOL + DB_PRIVATE + DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
int i; int i;
// populate the tree // populate the tree
r = db_create(&db, env, 0); assert(r == 0); r = db_create(&db, env, 0); assert(r == 0);
r = db->open(db, 0, "test.db", 0, DB_BTREE, DB_CREATE, 0777); assert(r == 0); r = db->open(db, 0, "test.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
for (i=0; i<n; i++) { for (i=0; i<n; i++) {
int k = htonl(i); int v = i; int k = htonl(i); int v = i;
...@@ -53,7 +53,7 @@ test_truncate_with_cursors (int n) { ...@@ -53,7 +53,7 @@ test_truncate_with_cursors (int n) {
// truncate // truncate
// walk the tree - expect 0 // walk the tree - expect 0
r = db_create(&db, env, 0); assert(r == 0); r = db_create(&db, env, 0); assert(r == 0);
r = db->open(db, 0, "test.db", 0, DB_UNKNOWN, 0, 0777); assert(r == 0); r = db->open(db, 0, "test.db", 0, DB_UNKNOWN, 0, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
i = 0; i = 0;
r = db->cursor(db, 0, &cursor, 0); assert(r == 0); r = db->cursor(db, 0, &cursor, 0); assert(r == 0);
...@@ -105,7 +105,7 @@ test_truncate_with_cursors (int n) { ...@@ -105,7 +105,7 @@ test_truncate_with_cursors (int n) {
// test 2: walk the tree - expect 0 // test 2: walk the tree - expect 0
r = db_create(&db, env, 0); assert(r == 0); r = db_create(&db, env, 0); assert(r == 0);
r = db->open(db, 0, "test.db", 0, DB_UNKNOWN, 0, 0777); assert(r == 0); r = db->open(db, 0, "test.db", 0, DB_UNKNOWN, 0, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
i = 0; i = 0;
r = db->cursor(db, 0, &cursor, 0); assert(r == 0); r = db->cursor(db, 0, &cursor, 0); assert(r == 0);
...@@ -130,7 +130,7 @@ int main(int argc, const char *argv[]) { ...@@ -130,7 +130,7 @@ int main(int argc, const char *argv[]) {
int leafentry = 25; int leafentry = 25;
int n = (nodesize/leafentry) * 2; int n = (nodesize/leafentry) * 2;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
int r = test_truncate_with_cursors(n); int r = test_truncate_with_cursors(n);
return r; return r;
} }
...@@ -13,14 +13,14 @@ test_txn_abort (int n) { ...@@ -13,14 +13,14 @@ test_txn_abort (int n) {
if (verbose) printf("test_txn_abort:%d\n", n); if (verbose) printf("test_txn_abort:%d\n", n);
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
int r; int r;
DB_ENV *env; DB_ENV *env;
r = db_env_create(&env, 0); assert(r == 0); r = db_env_create(&env, 0); assert(r == 0);
r = env->set_data_dir(env, ENVDIR); r = env->set_data_dir(env, ENVDIR);
r = env->set_lg_dir(env, ENVDIR); r = env->set_lg_dir(env, ENVDIR);
r = env->open(env, 0, DB_INIT_MPOOL + DB_INIT_LOG + DB_INIT_LOCK + DB_INIT_TXN + DB_PRIVATE + DB_CREATE, 0777); r = env->open(env, 0, DB_INIT_MPOOL + DB_INIT_LOG + DB_INIT_LOCK + DB_INIT_TXN + DB_PRIVATE + DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO);
if (r != 0) printf("%s:%d:%d:%s\n", __FILE__, __LINE__, r, db_strerror(r)); if (r != 0) printf("%s:%d:%d:%s\n", __FILE__, __LINE__, r, db_strerror(r));
assert(r == 0); assert(r == 0);
...@@ -29,7 +29,7 @@ test_txn_abort (int n) { ...@@ -29,7 +29,7 @@ test_txn_abort (int n) {
DB *db; DB *db;
r = db_create(&db, env, 0); assert(r == 0); r = db_create(&db, env, 0); assert(r == 0);
r = db->open(db, txn, "test.db", 0, DB_BTREE, DB_CREATE, 0777); assert(r == 0); r = db->open(db, txn, "test.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
r = txn->commit(txn, 0); assert(r == 0); r = txn->commit(txn, 0); assert(r == 0);
r = env->txn_begin(env, 0, &txn, 0); assert(r == 0); r = env->txn_begin(env, 0, &txn, 0); assert(r == 0);
......
...@@ -14,14 +14,14 @@ test_txn_abort (int n) { ...@@ -14,14 +14,14 @@ test_txn_abort (int n) {
if (verbose>1) printf("%s %s:%d\n", __FILE__, __FUNCTION__, n); if (verbose>1) printf("%s %s:%d\n", __FILE__, __FUNCTION__, n);
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
int r; int r;
DB_ENV *env; DB_ENV *env;
r = db_env_create(&env, 0); assert(r == 0); r = db_env_create(&env, 0); assert(r == 0);
r = env->set_data_dir(env, ENVDIR); r = env->set_data_dir(env, ENVDIR);
r = env->set_lg_dir(env, ENVDIR); r = env->set_lg_dir(env, ENVDIR);
r = env->open(env, 0, DB_INIT_MPOOL + DB_INIT_LOG + DB_INIT_LOCK + DB_INIT_TXN + DB_PRIVATE + DB_CREATE, 0777); r = env->open(env, 0, DB_INIT_MPOOL + DB_INIT_LOG + DB_INIT_LOCK + DB_INIT_TXN + DB_PRIVATE + DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO);
if (r != 0) printf("%s:%d:%d:%s\n", __FILE__, __LINE__, r, db_strerror(r)); if (r != 0) printf("%s:%d:%d:%s\n", __FILE__, __LINE__, r, db_strerror(r));
assert(r == 0); assert(r == 0);
...@@ -30,7 +30,7 @@ test_txn_abort (int n) { ...@@ -30,7 +30,7 @@ test_txn_abort (int n) {
DB *db; DB *db;
r = db_create(&db, env, 0); assert(r == 0); r = db_create(&db, env, 0); assert(r == 0);
r = db->open(db, txn, "test.db", 0, DB_BTREE, DB_CREATE, 0777); assert(r == 0); r = db->open(db, txn, "test.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
r = txn->commit(txn, 0); assert(r == 0); r = txn->commit(txn, 0); assert(r == 0);
r = env->txn_begin(env, 0, &txn, 0); assert(r == 0); r = env->txn_begin(env, 0, &txn, 0); assert(r == 0);
......
...@@ -15,14 +15,14 @@ test_txn_abort (int n, int which_guys_to_abort) { ...@@ -15,14 +15,14 @@ test_txn_abort (int n, int which_guys_to_abort) {
if (verbose>1) printf("test_txn_abort(%d,%x)\n", n, which_guys_to_abort); if (verbose>1) printf("test_txn_abort(%d,%x)\n", n, which_guys_to_abort);
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
int r; int r;
DB_ENV *env; DB_ENV *env;
r = db_env_create(&env, 0); assert(r == 0); r = db_env_create(&env, 0); assert(r == 0);
r = env->set_data_dir(env, ENVDIR); r = env->set_data_dir(env, ENVDIR);
r = env->set_lg_dir(env, ENVDIR); r = env->set_lg_dir(env, ENVDIR);
r = env->open(env, 0, DB_INIT_MPOOL + DB_INIT_LOG + DB_INIT_LOCK + DB_INIT_TXN + DB_PRIVATE + DB_CREATE, 0777); r = env->open(env, 0, DB_INIT_MPOOL + DB_INIT_LOG + DB_INIT_LOCK + DB_INIT_TXN + DB_PRIVATE + DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO);
if (r != 0) printf("%s:%d:%d:%s\n", __FILE__, __LINE__, r, db_strerror(r)); if (r != 0) printf("%s:%d:%d:%s\n", __FILE__, __LINE__, r, db_strerror(r));
assert(r == 0); assert(r == 0);
...@@ -32,7 +32,7 @@ test_txn_abort (int n, int which_guys_to_abort) { ...@@ -32,7 +32,7 @@ test_txn_abort (int n, int which_guys_to_abort) {
r = env->txn_begin(env, 0, &txn, 0); assert(r == 0); r = env->txn_begin(env, 0, &txn, 0); assert(r == 0);
r = db_create(&db, env, 0); assert(r == 0); r = db_create(&db, env, 0); assert(r == 0);
r = db->open(db, txn, "test.db", 0, DB_BTREE, DB_CREATE, 0777); assert(r == 0); r = db->open(db, txn, "test.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
r = txn->commit(txn, 0); assert(r == 0); r = txn->commit(txn, 0); assert(r == 0);
} }
{ {
......
...@@ -12,7 +12,7 @@ static void ...@@ -12,7 +12,7 @@ static void
test_abort_create (void) { test_abort_create (void) {
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
int r; int r;
DB_ENV *env; DB_ENV *env;
...@@ -20,7 +20,7 @@ test_abort_create (void) { ...@@ -20,7 +20,7 @@ test_abort_create (void) {
r = env->set_data_dir(env, ENVDIR); r = env->set_data_dir(env, ENVDIR);
r = env->set_lg_dir(env, ENVDIR); r = env->set_lg_dir(env, ENVDIR);
env->set_errfile(env, stdout); env->set_errfile(env, stdout);
r = env->open(env, 0, DB_INIT_MPOOL + DB_INIT_LOG + DB_INIT_LOCK + DB_INIT_TXN + DB_PRIVATE + DB_CREATE, 0777); r = env->open(env, 0, DB_INIT_MPOOL + DB_INIT_LOG + DB_INIT_LOCK + DB_INIT_TXN + DB_PRIVATE + DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO);
if (r != 0) printf("%s:%d:%d:%s\n", __FILE__, __LINE__, r, db_strerror(r)); if (r != 0) printf("%s:%d:%d:%s\n", __FILE__, __LINE__, r, db_strerror(r));
assert(r == 0); assert(r == 0);
...@@ -29,7 +29,7 @@ test_abort_create (void) { ...@@ -29,7 +29,7 @@ test_abort_create (void) {
DB *db; DB *db;
r = db_create(&db, env, 0); assert(r == 0); r = db_create(&db, env, 0); assert(r == 0);
r = db->open(db, txn, "test.db", 0, DB_BTREE, DB_CREATE, 0777); assert(r == 0); r = db->open(db, txn, "test.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
{ {
struct stat statbuf; struct stat statbuf;
......
...@@ -19,7 +19,7 @@ test_abort_close (void) { ...@@ -19,7 +19,7 @@ test_abort_close (void) {
return; return;
#else #else
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
int r; int r;
DB_ENV *env; DB_ENV *env;
...@@ -27,7 +27,7 @@ test_abort_close (void) { ...@@ -27,7 +27,7 @@ test_abort_close (void) {
r = env->set_data_dir(env, ENVDIR); r = env->set_data_dir(env, ENVDIR);
r = env->set_lg_dir(env, ENVDIR); r = env->set_lg_dir(env, ENVDIR);
env->set_errfile(env, stdout); env->set_errfile(env, stdout);
r = env->open(env, 0, DB_INIT_MPOOL + DB_INIT_LOG + DB_INIT_LOCK + DB_INIT_TXN + DB_PRIVATE + DB_CREATE, 0777); r = env->open(env, 0, DB_INIT_MPOOL + DB_INIT_LOG + DB_INIT_LOCK + DB_INIT_TXN + DB_PRIVATE + DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO);
if (r != 0) printf("%s:%d:%d:%s\n", __FILE__, __LINE__, r, db_strerror(r)); if (r != 0) printf("%s:%d:%d:%s\n", __FILE__, __LINE__, r, db_strerror(r));
assert(r == 0); assert(r == 0);
...@@ -36,7 +36,7 @@ test_abort_close (void) { ...@@ -36,7 +36,7 @@ test_abort_close (void) {
DB *db; DB *db;
r = db_create(&db, env, 0); assert(r == 0); r = db_create(&db, env, 0); assert(r == 0);
r = db->open(db, txn, "test.db", 0, DB_BTREE, DB_CREATE, 0777); assert(r == 0); r = db->open(db, txn, "test.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
{ {
struct stat statbuf; struct stat statbuf;
......
...@@ -19,7 +19,7 @@ test_abort_close (void) { ...@@ -19,7 +19,7 @@ test_abort_close (void) {
return; return;
#else #else
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
int r; int r;
DB_ENV *env; DB_ENV *env;
...@@ -27,7 +27,7 @@ test_abort_close (void) { ...@@ -27,7 +27,7 @@ test_abort_close (void) {
r = env->set_data_dir(env, ENVDIR); r = env->set_data_dir(env, ENVDIR);
r = env->set_lg_dir(env, ENVDIR); r = env->set_lg_dir(env, ENVDIR);
env->set_errfile(env, stdout); env->set_errfile(env, stdout);
r = env->open(env, 0, DB_INIT_MPOOL + DB_INIT_LOG + DB_INIT_LOCK + DB_INIT_TXN + DB_PRIVATE + DB_CREATE, 0777); r = env->open(env, 0, DB_INIT_MPOOL + DB_INIT_LOG + DB_INIT_LOCK + DB_INIT_TXN + DB_PRIVATE + DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO);
if (r != 0) printf("%s:%d:%d:%s\n", __FILE__, __LINE__, r, db_strerror(r)); if (r != 0) printf("%s:%d:%d:%s\n", __FILE__, __LINE__, r, db_strerror(r));
assert(r == 0); assert(r == 0);
...@@ -36,7 +36,7 @@ test_abort_close (void) { ...@@ -36,7 +36,7 @@ test_abort_close (void) {
DB *db; DB *db;
r = db_create(&db, env, 0); assert(r == 0); r = db_create(&db, env, 0); assert(r == 0);
r = db->open(db, txn, "test.db", 0, DB_BTREE, DB_CREATE, 0777); assert(r == 0); r = db->open(db, txn, "test.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
{ {
struct stat statbuf; struct stat statbuf;
...@@ -51,7 +51,7 @@ test_abort_close (void) { ...@@ -51,7 +51,7 @@ test_abort_close (void) {
// Now reopen it // Now reopen it
r = env->txn_begin(env, 0, &txn, 0); CKERR(r); r = env->txn_begin(env, 0, &txn, 0); CKERR(r);
r = db_create(&db, env, 0); assert(r == 0); r = db_create(&db, env, 0); assert(r == 0);
r = db->open(db, txn, "test.db", 0, DB_BTREE, 0, 0777); assert(r == 0); r = db->open(db, txn, "test.db", 0, DB_BTREE, 0, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
DBT k,v; DBT k,v;
r = db->put(db, txn, dbt_init(&k, "hello", 6), dbt_init(&v, "there", 6), 0); r = db->put(db, txn, dbt_init(&k, "hello", 6), dbt_init(&v, "there", 6), 0);
......
...@@ -11,12 +11,12 @@ int main(int UU(argc), char UU(*argv[])) { ...@@ -11,12 +11,12 @@ int main(int UU(argc), char UU(*argv[])) {
DB_ENV *env; DB_ENV *env;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
r = db_env_create(&env, 0); r = db_env_create(&env, 0);
assert(r == 0); assert(r == 0);
r = env->open(env, ENVDIR, DB_INIT_MPOOL + DB_INIT_LOG + DB_INIT_TXN + DB_PRIVATE + DB_CREATE, 0777); r = env->open(env, ENVDIR, DB_INIT_MPOOL + DB_INIT_LOG + DB_INIT_TXN + DB_PRIVATE + DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO);
assert(r == 0); assert(r == 0);
DB_TXN *txn; DB_TXN *txn;
......
...@@ -21,7 +21,7 @@ test_txn_close_open_commit (void) { ...@@ -21,7 +21,7 @@ test_txn_close_open_commit (void) {
return; return;
#else #else
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
int r; int r;
DB_ENV *env; DB_ENV *env;
...@@ -29,7 +29,7 @@ test_txn_close_open_commit (void) { ...@@ -29,7 +29,7 @@ test_txn_close_open_commit (void) {
r = env->set_data_dir(env, ENVDIR); r = env->set_data_dir(env, ENVDIR);
r = env->set_lg_dir(env, ENVDIR); r = env->set_lg_dir(env, ENVDIR);
env->set_errfile(env, stdout); env->set_errfile(env, stdout);
r = env->open(env, 0, DB_INIT_MPOOL + DB_INIT_LOG + DB_INIT_LOCK + DB_INIT_TXN + DB_PRIVATE + DB_CREATE, 0777); r = env->open(env, 0, DB_INIT_MPOOL + DB_INIT_LOG + DB_INIT_LOCK + DB_INIT_TXN + DB_PRIVATE + DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO);
if (r != 0) printf("%s:%d:%d:%s\n", __FILE__, __LINE__, r, db_strerror(r)); if (r != 0) printf("%s:%d:%d:%s\n", __FILE__, __LINE__, r, db_strerror(r));
assert(r == 0); assert(r == 0);
...@@ -38,7 +38,7 @@ test_txn_close_open_commit (void) { ...@@ -38,7 +38,7 @@ test_txn_close_open_commit (void) {
DB *db; DB *db;
r = db_create(&db, env, 0); assert(r == 0); r = db_create(&db, env, 0); assert(r == 0);
r = db->open(db, txn, "test.db", 0, DB_BTREE, DB_CREATE, 0777); assert(r == 0); r = db->open(db, txn, "test.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
{ {
struct stat statbuf; struct stat statbuf;
...@@ -55,7 +55,7 @@ test_txn_close_open_commit (void) { ...@@ -55,7 +55,7 @@ test_txn_close_open_commit (void) {
r = db->close(db, 0); assert(r == 0); r = db->close(db, 0); assert(r == 0);
r = db_create(&db, env, 0); assert(r == 0); r = db_create(&db, env, 0); assert(r == 0);
r = db->open(db, txn, "test.db", 0, DB_UNKNOWN, 0, 0777); assert(r == 0); r = db->open(db, txn, "test.db", 0, DB_UNKNOWN, 0, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
r = txn->commit(txn, 0); assert(r == 0); r = txn->commit(txn, 0); assert(r == 0);
......
...@@ -19,7 +19,7 @@ test_abort_close (void) { ...@@ -19,7 +19,7 @@ test_abort_close (void) {
return; return;
#else #else
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
int r; int r;
DB_ENV *env; DB_ENV *env;
...@@ -27,7 +27,7 @@ test_abort_close (void) { ...@@ -27,7 +27,7 @@ test_abort_close (void) {
r = env->set_data_dir(env, ENVDIR); r = env->set_data_dir(env, ENVDIR);
r = env->set_lg_dir(env, ENVDIR); r = env->set_lg_dir(env, ENVDIR);
env->set_errfile(env, stdout); env->set_errfile(env, stdout);
r = env->open(env, 0, DB_INIT_MPOOL + DB_INIT_LOG + DB_INIT_LOCK + DB_INIT_TXN + DB_PRIVATE + DB_CREATE, 0777); r = env->open(env, 0, DB_INIT_MPOOL + DB_INIT_LOG + DB_INIT_LOCK + DB_INIT_TXN + DB_PRIVATE + DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO);
if (r != 0) printf("%s:%d:%d:%s\n", __FILE__, __LINE__, r, db_strerror(r)); if (r != 0) printf("%s:%d:%d:%s\n", __FILE__, __LINE__, r, db_strerror(r));
assert(r == 0); assert(r == 0);
...@@ -36,7 +36,7 @@ test_abort_close (void) { ...@@ -36,7 +36,7 @@ test_abort_close (void) {
DB *db; DB *db;
r = db_create(&db, env, 0); assert(r == 0); r = db_create(&db, env, 0); assert(r == 0);
r = db->open(db, txn, "test.db", 0, DB_BTREE, DB_CREATE, 0777); assert(r == 0); r = db->open(db, txn, "test.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
{ {
struct stat statbuf; struct stat statbuf;
......
...@@ -38,7 +38,7 @@ test_txn_cursor_last_1 (int nrows) { ...@@ -38,7 +38,7 @@ test_txn_cursor_last_1 (int nrows) {
if (verbose) printf("test_txn_cursor_last_1:%d\n", nrows); if (verbose) printf("test_txn_cursor_last_1:%d\n", nrows);
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
DB_ENV *env; DB_ENV *env;
DB *db; DB *db;
...@@ -49,7 +49,7 @@ test_txn_cursor_last_1 (int nrows) { ...@@ -49,7 +49,7 @@ test_txn_cursor_last_1 (int nrows) {
/* create the dup database file */ /* create the dup database file */
r = db_env_create(&env, 0); assert(r == 0); r = db_env_create(&env, 0); assert(r == 0);
env->set_errfile(env, stderr); env->set_errfile(env, stderr);
r = env->open(env, ENVDIR, DB_CREATE|DB_INIT_MPOOL|DB_INIT_TXN|DB_INIT_LOCK|DB_INIT_LOG |DB_THREAD |DB_PRIVATE, 0777); CKERR(r); r = env->open(env, ENVDIR, DB_CREATE|DB_INIT_MPOOL|DB_INIT_TXN|DB_INIT_LOCK|DB_INIT_LOG |DB_THREAD |DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r = db_create(&db, env, 0); assert(r == 0); r = db_create(&db, env, 0); assert(r == 0);
db->set_errfile(db,stderr); // Turn off those annoying errors db->set_errfile(db,stderr); // Turn off those annoying errors
r = db->open(db, null_txn, fname, "main", DB_BTREE, DB_CREATE+DB_AUTO_COMMIT, 0666); assert(r == 0); r = db->open(db, null_txn, fname, "main", DB_BTREE, DB_CREATE+DB_AUTO_COMMIT, 0666); assert(r == 0);
...@@ -122,7 +122,7 @@ test_txn_cursor_last_2 (int nrows) { ...@@ -122,7 +122,7 @@ test_txn_cursor_last_2 (int nrows) {
if (verbose) printf("test_txn_cursor_last_2:%d\n", nrows); if (verbose) printf("test_txn_cursor_last_2:%d\n", nrows);
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
DB_ENV *env; DB_ENV *env;
DB *db; DB *db;
...@@ -133,7 +133,7 @@ test_txn_cursor_last_2 (int nrows) { ...@@ -133,7 +133,7 @@ test_txn_cursor_last_2 (int nrows) {
/* create the dup database file */ /* create the dup database file */
r = db_env_create(&env, 0); assert(r == 0); r = db_env_create(&env, 0); assert(r == 0);
env->set_errfile(env, stderr); env->set_errfile(env, stderr);
r = env->open(env, ENVDIR, DB_CREATE|DB_INIT_MPOOL|DB_INIT_TXN|DB_INIT_LOCK|DB_INIT_LOG|DB_THREAD|DB_PRIVATE, 0777); CKERR(r); r = env->open(env, ENVDIR, DB_CREATE|DB_INIT_MPOOL|DB_INIT_TXN|DB_INIT_LOCK|DB_INIT_LOG|DB_THREAD|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r = db_create(&db, env, 0); assert(r == 0); r = db_create(&db, env, 0); assert(r == 0);
db->set_errfile(db,stderr); // Turn off those annoying errors db->set_errfile(db,stderr); // Turn off those annoying errors
r = db->open(db, null_txn, fname, "main", DB_BTREE, DB_CREATE+DB_AUTO_COMMIT, 0666); assert(r == 0); r = db->open(db, null_txn, fname, "main", DB_BTREE, DB_CREATE+DB_AUTO_COMMIT, 0666); assert(r == 0);
......
...@@ -37,7 +37,7 @@ test_txn_nested(int do_commit) { ...@@ -37,7 +37,7 @@ test_txn_nested(int do_commit) {
if (verbose) printf("test_txn_nested:%d\n", do_commit); if (verbose) printf("test_txn_nested:%d\n", do_commit);
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
DB_ENV *env; DB_ENV *env;
DB *db; DB *db;
...@@ -48,7 +48,7 @@ test_txn_nested(int do_commit) { ...@@ -48,7 +48,7 @@ test_txn_nested(int do_commit) {
/* create the dup database file */ /* create the dup database file */
r = db_env_create(&env, 0); assert(r == 0); r = db_env_create(&env, 0); assert(r == 0);
env->set_errfile(env, stderr); env->set_errfile(env, stderr);
r = env->open(env, ENVDIR, DB_CREATE|DB_INIT_MPOOL|DB_INIT_TXN|DB_INIT_LOCK|DB_INIT_LOG |DB_THREAD |DB_PRIVATE, 0777); CKERR(r); r = env->open(env, ENVDIR, DB_CREATE|DB_INIT_MPOOL|DB_INIT_TXN|DB_INIT_LOCK|DB_INIT_LOG |DB_THREAD |DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r = db_create(&db, env, 0); assert(r == 0); r = db_create(&db, env, 0); assert(r == 0);
db->set_errfile(db,stderr); // Turn off those annoying errors db->set_errfile(db,stderr); // Turn off those annoying errors
r = db->open(db, null_txn, fname, "main", DB_BTREE, DB_CREATE+DB_AUTO_COMMIT, 0666); assert(r == 0); r = db->open(db, null_txn, fname, "main", DB_BTREE, DB_CREATE+DB_AUTO_COMMIT, 0666); assert(r == 0);
......
...@@ -12,7 +12,7 @@ static void ...@@ -12,7 +12,7 @@ static void
test_txn_abort (void) { test_txn_abort (void) {
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
int r; int r;
int i; int i;
...@@ -24,7 +24,7 @@ test_txn_abort (void) { ...@@ -24,7 +24,7 @@ test_txn_abort (void) {
r = db_env_create(&env, 0); CKERR(r); r = db_env_create(&env, 0); CKERR(r);
r = env->set_data_dir(env, ENVDIR); r = env->set_data_dir(env, ENVDIR);
r = env->set_lg_dir(env, ENVDIR); r = env->set_lg_dir(env, ENVDIR);
r = env->open(env, 0, DB_INIT_MPOOL | DB_INIT_LOG | DB_INIT_LOCK | DB_INIT_TXN | DB_PRIVATE | DB_CREATE, 0777); r = env->open(env, 0, DB_INIT_MPOOL | DB_INIT_LOG | DB_INIT_LOCK | DB_INIT_TXN | DB_PRIVATE | DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO);
CKERR(r); CKERR(r);
DB_TXN *txn = 0; DB_TXN *txn = 0;
...@@ -32,7 +32,7 @@ test_txn_abort (void) { ...@@ -32,7 +32,7 @@ test_txn_abort (void) {
DB *db; DB *db;
r = db_create(&db, env, 0); CKERR(r); r = db_create(&db, env, 0); CKERR(r);
r = db->open(db, txn, "test.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r = db->open(db, txn, "test.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r = txn->commit(txn, 0); CKERR(r); r = txn->commit(txn, 0); CKERR(r);
......
...@@ -12,7 +12,7 @@ static void ...@@ -12,7 +12,7 @@ static void
test_txn_abort (void) { test_txn_abort (void) {
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
int r; int r;
int i; int i;
...@@ -24,7 +24,7 @@ test_txn_abort (void) { ...@@ -24,7 +24,7 @@ test_txn_abort (void) {
r = db_env_create(&env, 0); CKERR(r); r = db_env_create(&env, 0); CKERR(r);
r = env->set_data_dir(env, ENVDIR); r = env->set_data_dir(env, ENVDIR);
r = env->set_lg_dir(env, ENVDIR); r = env->set_lg_dir(env, ENVDIR);
r = env->open(env, 0, DB_INIT_MPOOL | DB_INIT_LOG | DB_INIT_LOCK | DB_INIT_TXN | DB_PRIVATE | DB_CREATE, 0777); r = env->open(env, 0, DB_INIT_MPOOL | DB_INIT_LOG | DB_INIT_LOCK | DB_INIT_TXN | DB_PRIVATE | DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO);
CKERR(r); CKERR(r);
DB *db = NULL; DB *db = NULL;
...@@ -33,7 +33,7 @@ test_txn_abort (void) { ...@@ -33,7 +33,7 @@ test_txn_abort (void) {
r = env->txn_begin(env, 0, &txn, 0); CKERR(r); r = env->txn_begin(env, 0, &txn, 0); CKERR(r);
r = db_create(&db, env, 0); CKERR(r); r = db_create(&db, env, 0); CKERR(r);
r = db->open(db, txn, "test.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r = db->open(db, txn, "test.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r = txn->commit(txn, 0); CKERR(r); r = txn->commit(txn, 0); CKERR(r);
} }
......
...@@ -14,13 +14,13 @@ static DB_ENV *env; ...@@ -14,13 +14,13 @@ static DB_ENV *env;
static void static void
setup_db (void) { setup_db (void) {
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
int r; int r;
r = db_env_create(&env, 0); CKERR(r); r = db_env_create(&env, 0); CKERR(r);
r = env->set_data_dir(env, ENVDIR); r = env->set_data_dir(env, ENVDIR);
r = env->set_lg_dir(env, ENVDIR); r = env->set_lg_dir(env, ENVDIR);
r = env->open(env, 0, DB_INIT_MPOOL | DB_INIT_LOG | DB_INIT_LOCK | DB_INIT_TXN | DB_PRIVATE | DB_CREATE, 0777); r = env->open(env, 0, DB_INIT_MPOOL | DB_INIT_LOG | DB_INIT_LOCK | DB_INIT_TXN | DB_PRIVATE | DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO);
CKERR(r); CKERR(r);
{ {
...@@ -28,7 +28,7 @@ setup_db (void) { ...@@ -28,7 +28,7 @@ setup_db (void) {
r = env->txn_begin(env, 0, &txn, 0); CKERR(r); r = env->txn_begin(env, 0, &txn, 0); CKERR(r);
r = db_create(&db, env, 0); CKERR(r); r = db_create(&db, env, 0); CKERR(r);
r = db->open(db, txn, "test.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r = db->open(db, txn, "test.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r = txn->commit(txn, 0); CKERR(r); r = txn->commit(txn, 0); CKERR(r);
} }
} }
......
...@@ -18,8 +18,8 @@ test_txn_recover3 (int nrows) { ...@@ -18,8 +18,8 @@ test_txn_recover3 (int nrows) {
if (verbose) printf("test_txn_recover1:%d\n", nrows); if (verbose) printf("test_txn_recover1:%d\n", nrows);
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
mkdir(ENVDIR "/" "t.tokudb", 0777); toku_os_mkdir(ENVDIR "/" "t.tokudb", S_IRWXU+S_IRWXG+S_IRWXO);
DB_ENV *env; DB_ENV *env;
DB *mdb, *sdb; DB *mdb, *sdb;
...@@ -30,7 +30,7 @@ test_txn_recover3 (int nrows) { ...@@ -30,7 +30,7 @@ test_txn_recover3 (int nrows) {
r = db_env_create(&env, 0); assert(r == 0); r = db_env_create(&env, 0); assert(r == 0);
env->set_errfile(env, stderr); env->set_errfile(env, stderr);
r = env->open(env, ENVDIR, DB_CREATE|DB_INIT_MPOOL|DB_INIT_TXN|DB_INIT_LOCK|DB_INIT_LOG |DB_THREAD |DB_PRIVATE | DB_RECOVER, 0777); CKERR(r); r = env->open(env, ENVDIR, DB_CREATE|DB_INIT_MPOOL|DB_INIT_TXN|DB_INIT_LOCK|DB_INIT_LOG |DB_THREAD |DB_PRIVATE | DB_RECOVER, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r = db_create(&mdb, env, 0); assert(r == 0); r = db_create(&mdb, env, 0); assert(r == 0);
mdb->set_errfile(mdb,stderr); // Turn off those annoying errors mdb->set_errfile(mdb,stderr); // Turn off those annoying errors
...@@ -84,7 +84,7 @@ test_txn_recover3 (int nrows) { ...@@ -84,7 +84,7 @@ test_txn_recover3 (int nrows) {
r = db_env_create(&env, 0); assert(r == 0); r = db_env_create(&env, 0); assert(r == 0);
env->set_errfile(env, stderr); env->set_errfile(env, stderr);
r = env->open(env, ENVDIR, DB_CREATE|DB_INIT_MPOOL|DB_INIT_TXN|DB_INIT_LOCK|DB_INIT_LOG |DB_THREAD |DB_PRIVATE | DB_RECOVER, 0777); CKERR(r); r = env->open(env, ENVDIR, DB_CREATE|DB_INIT_MPOOL|DB_INIT_TXN|DB_INIT_LOCK|DB_INIT_LOG |DB_THREAD |DB_PRIVATE | DB_RECOVER, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r = env->close(env, 0); assert(r == 0); r = env->close(env, 0); assert(r == 0);
} }
......
...@@ -83,7 +83,7 @@ int main(int argc, const char *argv[]) { ...@@ -83,7 +83,7 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv); parse_args(argc, argv);
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
int r=mkdir(ENVDIR, 0777); assert(r==0); int r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
int i; int i;
for (i=1; i<=65536; i *= 2) { for (i=1; i<=65536; i *= 2) {
......
...@@ -17,13 +17,13 @@ test_autotxn (u_int32_t env_flags, u_int32_t db_flags) { ...@@ -17,13 +17,13 @@ test_autotxn (u_int32_t env_flags, u_int32_t db_flags) {
DB *db; DB *db;
int r; int r;
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
r = db_env_create (&env, 0); CKERR(r); r = db_env_create (&env, 0); CKERR(r);
env->set_errfile(env, stderr); env->set_errfile(env, stderr);
r = env->set_flags(env, env_flags, 1); CKERR(r); r = env->set_flags(env, env_flags, 1); CKERR(r);
r = env->open(env, ENVDIR, r = env->open(env, ENVDIR,
DB_CREATE | DB_PRIVATE | DB_INIT_MPOOL | DB_CREATE | DB_PRIVATE | DB_INIT_MPOOL |
DB_INIT_LOG | DB_INIT_TXN | DB_INIT_LOCK, 0777); CKERR(r); DB_INIT_LOG | DB_INIT_TXN | DB_INIT_LOCK, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r = db_create(&db, env, 0); r = db_create(&db, env, 0);
CKERR(r); CKERR(r);
{ {
......
...@@ -144,7 +144,7 @@ int main(int argc, const char *argv[]) { ...@@ -144,7 +144,7 @@ int main(int argc, const char *argv[]) {
SET_TRACE_FILE(TFILE); SET_TRACE_FILE(TFILE);
system("rm -rf " ENVDIR); system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777); toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
test_insert_zero_length(32, 0, "test0"); test_insert_zero_length(32, 0, "test0");
test_insert_zero_length_keys(32, 0, "test0keys"); test_insert_zero_length_keys(32, 0, "test0keys");
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#define _TOKUWIN_UNISTD_H #define _TOKUWIN_UNISTD_H
#include <io.h> #include <io.h>
#include <stdio.h> #include <stdio.h>
#include <stdint.h>
int int
ftruncate(int fildes, int64_t offset); ftruncate(int fildes, int64_t offset);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment