1*9507f98cSAndroid Build Coastguard Worker // Copyright 2017 The LevelDB Authors. All rights reserved. 2*9507f98cSAndroid Build Coastguard Worker // Use of this source code is governed by a BSD-style license that can be 3*9507f98cSAndroid Build Coastguard Worker // found in the LICENSE file. See the AUTHORS file for names of contributors. 4*9507f98cSAndroid Build Coastguard Worker 5*9507f98cSAndroid Build Coastguard Worker #ifndef STORAGE_LEVELDB_UTIL_ENV_POSIX_TEST_HELPER_H_ 6*9507f98cSAndroid Build Coastguard Worker #define STORAGE_LEVELDB_UTIL_ENV_POSIX_TEST_HELPER_H_ 7*9507f98cSAndroid Build Coastguard Worker 8*9507f98cSAndroid Build Coastguard Worker namespace leveldb { 9*9507f98cSAndroid Build Coastguard Worker 10*9507f98cSAndroid Build Coastguard Worker class EnvPosixTest; 11*9507f98cSAndroid Build Coastguard Worker 12*9507f98cSAndroid Build Coastguard Worker // A helper for the POSIX Env to facilitate testing. 13*9507f98cSAndroid Build Coastguard Worker class EnvPosixTestHelper { 14*9507f98cSAndroid Build Coastguard Worker private: 15*9507f98cSAndroid Build Coastguard Worker friend class EnvPosixTest; 16*9507f98cSAndroid Build Coastguard Worker 17*9507f98cSAndroid Build Coastguard Worker // Set the maximum number of read-only files that will be opened. 18*9507f98cSAndroid Build Coastguard Worker // Must be called before creating an Env. 19*9507f98cSAndroid Build Coastguard Worker static void SetReadOnlyFDLimit(int limit); 20*9507f98cSAndroid Build Coastguard Worker 21*9507f98cSAndroid Build Coastguard Worker // Set the maximum number of read-only files that will be mapped via mmap. 22*9507f98cSAndroid Build Coastguard Worker // Must be called before creating an Env. 23*9507f98cSAndroid Build Coastguard Worker static void SetReadOnlyMMapLimit(int limit); 24*9507f98cSAndroid Build Coastguard Worker }; 25*9507f98cSAndroid Build Coastguard Worker 26*9507f98cSAndroid Build Coastguard Worker } // namespace leveldb 27*9507f98cSAndroid Build Coastguard Worker 28*9507f98cSAndroid Build Coastguard Worker #endif // STORAGE_LEVELDB_UTIL_ENV_POSIX_TEST_HELPER_H_ 29