xref: /aosp_15_r20/external/cronet/base/files/file_path_watcher_inotify.h (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Copyright 2021 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef BASE_FILES_FILE_PATH_WATCHER_INOTIFY_H_
6 #define BASE_FILES_FILE_PATH_WATCHER_INOTIFY_H_
7 
8 #include <stddef.h>
9 
10 #include "base/base_export.h"
11 
12 namespace base {
13 
14 // Get the maximum number of inotify watches can be used by a FilePathWatcher
15 // instance. This is based on /proc/sys/fs/inotify/max_user_watches entry.
16 BASE_EXPORT size_t GetMaxNumberOfInotifyWatches();
17 
18 // Overrides max inotify watcher counter for test.
19 class BASE_EXPORT ScopedMaxNumberOfInotifyWatchesOverrideForTest {
20  public:
21   explicit ScopedMaxNumberOfInotifyWatchesOverrideForTest(size_t override_max);
22   ~ScopedMaxNumberOfInotifyWatchesOverrideForTest();
23 };
24 
25 }  // namespace base
26 
27 #endif  // BASE_FILES_FILE_PATH_WATCHER_INOTIFY_H_
28