Commit d0ffa10e 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 1a95f0ae
......@@ -82,7 +82,7 @@ setup (void) {
DB_TXN *txn;
int r;
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=env->set_lk_max_locks(env, N); CKERR(r);
......@@ -90,11 +90,11 @@ setup (void) {
r=env->set_lk_max_objects(env, N); CKERR(r);
#endif
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=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);
}
......
......@@ -82,7 +82,7 @@ setup (void) {
DB_TXN *txn;
int r;
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=env->set_lk_max_locks(env, N); CKERR(r);
......@@ -90,11 +90,11 @@ setup (void) {
r=env->set_lk_max_objects(env, N); CKERR(r);
#endif
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=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);
}
......
......@@ -77,7 +77,7 @@ setup (void) {
DB_TXN *txn;
int r;
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=env->set_lk_max_locks(env, N); CKERR(r);
......@@ -85,12 +85,12 @@ setup (void) {
r=env->set_lk_max_objects(env, N); CKERR(r);
#endif
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->set_flags(db, DB_DUPSORT);
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);
}
......
......@@ -77,7 +77,7 @@ setup (void) {
DB_TXN *txn;
int r;
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=env->set_lk_max_locks(env, N); CKERR(r);
......@@ -85,12 +85,12 @@ setup (void) {
r=env->set_lk_max_objects(env, N); CKERR(r);
#endif
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->set_flags(db, DB_DUPSORT);
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);
}
......
......@@ -9,17 +9,17 @@ do_627 (void) {
DB_ENV *env;
DB *db;
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);
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);
DB_TXN *t1, *t2;
DBT a,b;
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=t1->commit(t1, 0); assert(r==0);
......
......@@ -13,7 +13,7 @@ static void
setup (void) {
system("rm -rf " ENVDIR);
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);
env->set_errfile(env, stderr);
......@@ -21,13 +21,13 @@ setup (void) {
r=env->set_lk_max_objects(env, 2*num_insert); CKERR(r);
#endif
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=env->txn_begin(env, 0, &txn, 0); assert(r==0);
r=db->set_bt_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);
}
......
......@@ -11,15 +11,15 @@ static void
test_setup (void) {
system("rm -rf " ENVDIR);
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);
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=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);
}
......
......@@ -17,17 +17,17 @@ static void test (void) {
u_int64_t ilimit=100;
int r;
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);
// set the cachetable to size 1 so that things won't fit.
r=env->set_cachesize(env, 0, 1, 1);
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->set_flags(db, DB_DUP|DB_DUPSORT); assert(r==0);
r=db->set_pagesize(db, 4096);
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=env->txn_begin(env, 0, &txn, 0); assert(r==0);
......
......@@ -17,17 +17,17 @@ static void test (void) {
u_int64_t ilimit=10;
int r;
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);
// set the cachetable to size 1 so that things won't fit.
r=env->set_cachesize(env, 0, 1, 1);
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->set_flags(db, DB_DUP|DB_DUPSORT); assert(r==0);
r=db->set_pagesize(db, 4096);
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=env->txn_begin(env, 0, &txn, 0); assert(r==0);
......
......@@ -18,16 +18,16 @@ static void test (void) {
int r;
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);
// set the cachetable to size 1 so that things won't fit.
r=env->set_cachesize(env, 0, 1, 1);
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->set_pagesize(db, 4096);
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);
u_int64_t i;
......
......@@ -17,14 +17,14 @@ static void test (void) {
int r;
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);
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->set_pagesize(db, 4096);
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);
u_int64_t i;
......
......@@ -16,11 +16,11 @@ static void
test_setup (void) {
system("rm -rf " ENVDIR);
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);
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);
......@@ -31,7 +31,7 @@ test_setup (void) {
snprintf(fname, sizeof(fname), "foo%d.db", i);
r=db_create(&dbs[i], env, 0); CKERR(r);
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);
}
......
......@@ -86,7 +86,7 @@ test_setup (void) {
DB_TXN *txn;
int r;
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=env->set_lk_max_locks(env, N); CKERR(r);
......@@ -94,12 +94,12 @@ test_setup (void) {
r=env->set_lk_max_objects(env, N); CKERR(r);
#endif
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->set_flags(db, DB_DUPSORT);
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);
}
......
......@@ -11,7 +11,7 @@
static void test (void) {
int r;
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_TXN *tid;
......@@ -20,11 +20,11 @@ static void test (void) {
r=db_env_create(&env, 0); assert(r==0);
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=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=env->txn_begin(env, 0, &tid, 0); assert(r==0);
......@@ -38,10 +38,10 @@ static void test (void) {
r=db_env_create(&env, 0); assert(r==0);
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=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=tid->commit(tid, 0); assert(r==0);
free(data.data);
......
......@@ -11,7 +11,7 @@
static void test (void) {
int r;
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_TXN *tid;
......@@ -20,11 +20,11 @@ static void test (void) {
r=db_env_create(&env, 0); assert(r==0);
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=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=env->txn_begin(env, 0, &tid, 0); assert(r==0);
......@@ -48,10 +48,10 @@ static void test (void) {
r=db_env_create(&env, 0); assert(r==0);
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=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++) {
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);
......
......@@ -16,7 +16,7 @@
static void test (void) {
int r;
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_TXN *tid;
......@@ -25,11 +25,11 @@ static void test (void) {
r=db_env_create(&env, 0); assert(r==0);
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=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=env->txn_begin(env, 0, &tid, 0); assert(r==0);
......@@ -57,10 +57,10 @@ static void test (void) {
r=db_env_create(&env, 0); assert(r==0);
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=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++) {
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);
......
......@@ -121,19 +121,19 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv);
system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777);
toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
int r;
DB_TXN *txn;
{
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);
r=env->txn_begin(env, 0, &txn, 0); CKERR(r);
r=db_create(&db, env, 0); CKERR(r);
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);
}
int i;
......
......@@ -53,19 +53,19 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv);
system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777);
toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
int r;
DB_TXN *txn;
{
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);
r=env->txn_begin(env, 0, &txn, 0); CKERR(r);
r=db_create(&db, env, 0); CKERR(r);
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);
}
run();
......
......@@ -54,19 +54,19 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv);
system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777);
toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
int r;
DB_TXN *txn;
{
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);
r=env->txn_begin(env, 0, &txn, 0); CKERR(r);
r=db_create(&db, env, 0); CKERR(r);
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);
}
run();
......
......@@ -111,19 +111,19 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv);
system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777);
toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
int r;
DB_TXN *txn;
{
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);
r=env->txn_begin(env, 0, &txn, 0); CKERR(r);
r=db_create(&db, env, 0); CKERR(r);
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);
}
int i;
......
......@@ -108,18 +108,18 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv);
system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777);
toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
int r;
DB_TXN *txn;
{
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);
r=env->txn_begin(env, 0, &txn, 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);
}
int i;
......
......@@ -15,7 +15,7 @@ test_789(void) {
/* setup test directory */
system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777);
toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
/* setup environment */
DB_ENV *env;
......@@ -24,7 +24,7 @@ test_789(void) {
r = env->set_data_dir(env, ENVDIR);
r = env->set_lg_dir(env, ENVDIR);
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);
}
......@@ -35,7 +35,7 @@ test_789(void) {
r = env->txn_begin(env, 0, &txn, 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);
}
......
......@@ -17,7 +17,7 @@ testit (const int klen, const int vlen, const int n, const int lastvlen) {
// setup test directory
system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777);
toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
// setup environment
DB_ENV *env;
......@@ -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_lg_dir(env, ENVDIR);
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);
}
......@@ -35,7 +35,7 @@ testit (const int klen, const int vlen, const int n, const int lastvlen) {
{
DB_TXN *txn = 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
......
......@@ -23,15 +23,15 @@ test_db_open_aborts (void) {
int r;
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=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);
#if 0
{
DB_TXN *tid;
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);
}
{
......@@ -77,15 +77,15 @@ test_db_put_aborts (void) {
int r;
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=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);
{
DB_TXN *tid;
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);
}
{
......
......@@ -30,15 +30,15 @@ static void
do_test_abort2 (void) {
int r;
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);
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->set_pagesize(db, 4096); // Use a small page
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=env->txn_begin(env, 0, &txn, 0); assert(r==0);
......@@ -57,10 +57,10 @@ do_test_abort2 (void) {
// Now do a few inserts that abort.
r=db_env_create(&env, 0); assert(r==0);
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=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
{
u_int32_t ps;
......@@ -89,7 +89,7 @@ do_test_abort2 (void) {
//printf("%s:%d\n", __FILE__, __LINE__);
r=db_create(&db, env, 0); CKERR(r);
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);
//printf("%s:%d\n", __FILE__, __LINE__);
......
......@@ -66,15 +66,15 @@ static void
test_abort3 (void) {
int r;
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);
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=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);
r=txn->commit(txn, 0); assert(r==0);
......
......@@ -81,15 +81,15 @@ do_abort_delete_first_or_last(int N,
) {
int r,i;
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);
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->set_pagesize(db, 4096); // Use a small page
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);
// First fill up the db
......
......@@ -14,14 +14,14 @@ int main (int argc, const char *argv[]) {
int r;
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);
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=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);
char **list;
......
......@@ -12,15 +12,15 @@ int main (int argc, const char *argv[]) {
int r;
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);
env->set_errfile(env, stderr);
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=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);
int i;
......
......@@ -13,21 +13,21 @@ int main (int argc, const char *argv[]) {
int r;
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);
env->set_errfile(env, stderr);
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=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=db_create(&db2, env, 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=env->txn_begin(env, 0, &txn2, 0); CKERR(r);
......
......@@ -26,7 +26,7 @@ test_cursor (void) {
/* create the dup database file */
r = db_env_create(&env, 0); assert(r == 0);
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);
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);
......@@ -83,7 +83,7 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv);
system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777);
toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
test_cursor();
......
......@@ -59,7 +59,7 @@ test (void) {
/* create the dup database file */
r = db_env_create(&env, 0); assert(r == 0);
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);
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);
......@@ -95,7 +95,7 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv);
system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777);
toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
test();
......
......@@ -23,12 +23,12 @@ static DB_TXN* null_txn = NULL;
static void setup_env(void) {
assert(!env && !db && !cursor);
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);
assert(env);
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);
assert(env);
}
......
......@@ -120,7 +120,7 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv);
system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777);
toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
test_cursor_current();
test_reopen();
......
......@@ -65,7 +65,7 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv);
system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777);
toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
test_cursor_delete2();
......
......@@ -67,7 +67,7 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv);
system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777);
toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
test_cursor_delete2();
......
......@@ -25,7 +25,7 @@ setup_db (char* name) {
int r;
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 = 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[]) {
parse_args(argc, argv);
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, EINVAL);
......
......@@ -92,7 +92,7 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv);
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;
for (i=1; i<=65536; i *= 2) {
......
......@@ -111,7 +111,7 @@ setup_dbs (u_int32_t dup_flags) {
int r;
system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777);
toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
dbenv = NULL;
db = NULL;
/* Open/create primary */
......
......@@ -22,7 +22,7 @@ int main() {
int r;
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 = db_create(&db, null_env, 0); CKERR(r);
......
......@@ -557,7 +557,7 @@ int main (int argc, const char *argv[]) {
switch (mode) {
case MODE_DEFAULT:
system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777);
toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
create_databases();
{
int i;
......
......@@ -19,9 +19,9 @@ DB *db;
int main (int UU(argc), char UU(*argv[])) {
int r;
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=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->close(db, 0); assert(r==0);
r=env->close(env, 0); assert(r==0);
......
......@@ -20,9 +20,9 @@ DB_TXN* null_txn = NULL;
int main (int UU(argc), char UU(*argv[])) {
int r;
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=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->open(db, null_txn, "foo.db", "main", DB_BTREE, DB_CREATE, 0666); CKERR(r);
DBC *cursor;
......
......@@ -530,7 +530,7 @@ int main (int argc, const char *argv[]) {
case MODE_DEFAULT:
oppass=1;
system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777);
toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
create_databases();
{
int i;
......
......@@ -335,7 +335,7 @@ int main (int argc, const char *argv[]) {
case MODE_DEFAULT:
opnum=0;
system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777);
toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
create_databases();
{
int i;
......
......@@ -141,7 +141,7 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv);
system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777);
toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
second_setup();
for (i = 0; i < 2; i++) {
callback_set_malloc = i & 0x1;
......
......@@ -83,7 +83,7 @@ static void second_setup (u_int32_t dupflags) {
int r;
system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777);
toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
dbenv = 0;
/* Open/create primary */
r = db_create(&db, dbenv, 0); CKERR(r);
......
......@@ -28,7 +28,7 @@ setup(void) {
int r;
system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777);
toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
dbenv = 0;
/* Open/create primary */
r = db_create(&db, dbenv, 0); CKERR(r);
......
......@@ -53,7 +53,7 @@ test_db_delboth (int n, int dup_mode) {
int r;
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 */
r = db_create(&db, null_env, 0);
......
......@@ -47,7 +47,7 @@ test_db_delete (int n, int dup_mode) {
int r;
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 */
r = db_create(&db, null_env, 0);
......@@ -113,7 +113,7 @@ test_db_get_datasize0 (void) {
int r;
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 */
r = db_create(&db, null_env, 0);
......
......@@ -130,7 +130,7 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv);
for (i = 0; i < (1<<3); i++) {
system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777);
toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
second_setup();
check_secondary(DB_NOTFOUND);
......
......@@ -43,17 +43,17 @@ reinit_config (int set_home, int set_DB_ENVIRON, int set_DB_HOME) {
r = fchdir(rootfd); 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);
unsetenv(DB_HOME);
if (set_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) {
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 = ".";
......
......@@ -43,7 +43,7 @@ int main() {
dbenv->close(dbenv,0); // free memory
system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777);
toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
r = db_env_create(&dbenv, 0);
CKERR(r);
r = dbenv->open(dbenv, ENVDIR, private_flags|DB_INIT_MPOOL, 0);
......@@ -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.
DB *db;
system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777);
toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
r = db_env_create(&dbenv, 0);
CKERR(r);
r = dbenv->open(dbenv, ENVDIR, DB_CREATE|DB_INIT_MPOOL, 0);
......
......@@ -21,7 +21,7 @@ int main(int argc, char** argv) {
if (argc == 2 && !strcmp(argv[1], "-v")) verbose = 1;
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);
assert(r == 0);
......
......@@ -18,7 +18,7 @@ int main() {
int r;
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);
......@@ -39,7 +39,7 @@ int main() {
DB *db;
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);
......
......@@ -16,7 +16,7 @@ int main() {
int r;
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);
......
......@@ -19,7 +19,7 @@ int main() {
int r;
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);
......
......@@ -19,7 +19,7 @@ int main() {
int r;
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);
......
......@@ -19,12 +19,12 @@ DB *db;
int main (int UU(argc), char UU(*argv[])) {
int r;
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);
// None of this stuff works with BDB. TDB does more error checking.
#ifdef USE_TDB
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.
r=env->set_tmp_dir(env, NULL); assert(r==EINVAL);
#endif
......
......@@ -59,7 +59,7 @@ setup (u_int32_t flags) {
int r;
system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777);
toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
/* Open/create primary */
r = db_create(&dbp, dbenv, 0); CKERR(r);
dbp->set_errfile(dbp,0); // Turn off those annoying errors
......
......@@ -19,9 +19,9 @@ DB *db;
int main (int UU(argc), char UU(*argv[])) {
int r;
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=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->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);
......
......@@ -22,14 +22,14 @@ DBT data;
int main (int UU(argc), char UU(*argv[])) {
int r;
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(&data, 0, sizeof(data));
key.size = sizeof("name");
key.data = "name";
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->open(db, NULL, "master.db", NULL, DB_BTREE, DB_CREATE, 0666); assert(r==0);
......
......@@ -22,7 +22,7 @@ DBT data;
int main (int UU(argc), char UU(*argv[])) {
int r;
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(&data, 0, sizeof(data));
key.size = sizeof("name");
......@@ -30,7 +30,7 @@ int main (int UU(argc), char UU(*argv[])) {
r=db_env_create(&env, 0); assert(r==0);
// 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->remove(db, "DoesNotExist.db", NULL, 0); assert(r==ENOENT);
......
......@@ -192,7 +192,7 @@ int main() {
int r;
system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777);
toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
second_setup();
insert_test();
......
......@@ -38,7 +38,7 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv);
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, DB_DUP, EINVAL);
......
......@@ -22,11 +22,11 @@ int main() {
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);
// 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);
......
......@@ -22,11 +22,11 @@ int main() {
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);
// 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->open(db, null_txn, fname, "main", DB_BTREE, DB_CREATE, 0666); CKERR(r);
......
......@@ -187,7 +187,7 @@ setup_dbs (u_int32_t dup_flags) {
int r;
system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777);
toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
dbenv = NULL;
db = NULL;
/* Open/create primary */
......
......@@ -86,7 +86,7 @@ setup_dbs (u_int32_t dup_flags) {
int r;
system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777);
toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
dbenv = NULL;
db = NULL;
/* Open/create primary */
......
......@@ -723,7 +723,7 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv);
system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777);
toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
#ifdef USE_BDB
/* dup tests */
......
......@@ -227,7 +227,7 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv);
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, DB_NOOVERWRITE);
......
......@@ -73,7 +73,7 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv);
system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777);
toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
/* test flags */
test_dup_flags(0);
......
......@@ -255,7 +255,7 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv);
system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777);
toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
/* nodup tests */
for (i = 1; i <= (1<<16); i *= 2) {
......
......@@ -133,7 +133,7 @@ int main(int argc, const char *argv[]) {
}
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) {
test_dup_next(i, DB_DUP + DB_DUPSORT);
......
......@@ -326,7 +326,7 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv);
system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777);
toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
int limit = 1<<13;
if (verbose > 1)
......
......@@ -71,16 +71,16 @@ static void
test_dupsort_del (void) {
int r;
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);
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->set_flags(db, DB_DUPSORT);
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, 1);
r=txn->commit(txn, 0); assert(r==0);
......
......@@ -73,16 +73,16 @@ static void
test_abort3 (void) {
int r;
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);
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->set_flags(db, DB_DUPSORT);
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, 1);
r=txn->commit(txn, 0); assert(r==0);
......@@ -99,7 +99,7 @@ test_abort3 (void) {
r=db_create(&db, env, 0); CKERR(r);
r=db->set_flags(db, DB_DUPSORT);
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);
r=txn->commit(txn, 0); CKERR(r);
r=db->close(db, 0); CKERR(r);
......
......@@ -102,7 +102,7 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv);
system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777);
toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
// test_dupsort_delete(256); return 0;
/* nodup tests */
......
......@@ -124,7 +124,7 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv);
system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777);
toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
int limit = 1<<13;
if (verbose > 1)
......
......@@ -149,7 +149,7 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv);
system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777);
toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
int limit = 1<<13;
if (verbose > 1)
......
......@@ -155,7 +155,7 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv);
system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777);
toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
int limit = 1<<13;
if (verbose > 1)
......
......@@ -150,7 +150,7 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv);
system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777);
toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
int limit = 1<<13;
if (verbose > 1)
......
......@@ -157,7 +157,7 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv);
system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777);
toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
int limit = 1<<13;
if (verbose > 1)
......
......@@ -18,12 +18,12 @@ int main (int argc __attribute__((__unused__)), char *argv[] __attribute__((__u
DB_ENV *env;
int r;
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);
env->set_errfile(env,0); // Turn off those annoying errors
r=env->close (env, 0); assert(r==0);
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);
env->set_errfile(env,0); // Turn off those annoying errors
r=env->close (env, 1);
......@@ -34,19 +34,19 @@ int main (int argc __attribute__((__unused__)), char *argv[] __attribute__((__u
assert(r==0);
#endif
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);
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);
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);
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);
//BDB does not check this.
#if defined(USE_TDB) || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 3)
......
......@@ -36,7 +36,7 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv);
system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777);
toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
#ifdef USE_TDB
toku_set_trace_file(ENVDIR "/trace.tktrace");
......
......@@ -21,7 +21,7 @@ int main (int argc, const char *argv[]) {
#else
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;
......
......@@ -168,7 +168,7 @@ int main(int argc, const char *argv[]) {
snprintf(rmcmd, sizeof(rmcmd), "rm -rf %s", annotated_envdir);
system(rmcmd);
}
mkdir(annotated_envdir, 0777);
toku_os_mkdir(annotated_envdir, S_IRWXU+S_IRWXG+S_IRWXO);
if (doi==0) {
for (i=1; i <= 256; i *= 2) {
......
......@@ -34,7 +34,7 @@ test_get (int dup_mode) {
int main (int argc, const char *argv[]) {
parse_args(argc, argv);
system("rm -rf " ENVDIR);
mkdir(ENVDIR, 0777);
toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
test_get(0);
test_get(DB_DUP + DB_DUPSORT);
......
......@@ -39,10 +39,10 @@ test_groupcommit (int nthreads) {
DB_TXN *tid;
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=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);
int i;
......@@ -108,7 +108,7 @@ int main (int argc, const char *argv[]) {
{ int r = db_env_set_func_fsync(do_fsync); CKERR(r); }
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(2); printtdiff("2 threads");
......
......@@ -39,10 +39,10 @@ test_groupcommit (int nthreads) {
DB_TXN *tid;
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=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);
int i;
......@@ -97,7 +97,7 @@ int main (int argc, const char *argv[]) {
parse_args(argc, argv);
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);
test_groupcommit(1); printtdiff("1 thread");
......
......@@ -49,7 +49,7 @@ test_hsoc (int pagesize, int dup_mode) {
int r;
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 */
r = db_create(&db, null_env, 0); assert(r == 0);
......
......@@ -68,7 +68,7 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv);
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(DB_DUP + DB_DUPSORT);
......
......@@ -48,7 +48,7 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv);
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);
......
......@@ -26,7 +26,7 @@ test_key_size_limit (int dup_mode) {
int r;
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 */
r = db_create(&db, null_env, 0);
......@@ -82,7 +82,7 @@ test_data_size_limit (int dup_mode) {
int r;
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 */
r = db_create(&db, null_env, 0);
......
......@@ -18,9 +18,9 @@ DB_ENV *env;
int main (int UU(argc), char UU(*argv[])) {
int r;
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=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);
return 0;
}
......@@ -23,12 +23,12 @@ DB_TXN *tid;
int main (int UU(argc), char UU(*argv[])) {
int r;
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=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=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;
memset(&key, 0, sizeof(key));
......
......@@ -35,10 +35,10 @@ static void insert_some (int outeri) {
DB_TXN *tid;
r=db_env_create(&env, 0); assert(r==0);
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=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=env->txn_begin(env, 0, &tid, 0); assert(r==0);
......@@ -80,13 +80,13 @@ static void make_db (void) {
int i;
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=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=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=db->close(db, 0); CKERR(r);
r=env->close(env, 0); CKERR(r);
......
......@@ -24,12 +24,12 @@ DB_TXN *tid;
int main (int UU(argc), char UU(*argv[])) {
int r;
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=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=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;
memset(&key, 0, sizeof(key));
......
......@@ -22,13 +22,13 @@ static void make_db (void) {
int r;
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);
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=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=db->close(db, 0); assert(r==0);
r=env->close(env, 0); assert(r==0);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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