Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
michael@0 | 2 | // Use of this source code is governed by a BSD-style license that can be |
michael@0 | 3 | // found in the LICENSE file. |
michael@0 | 4 | |
michael@0 | 5 | #ifndef BASE_DIR_READER_POSIX_H_ |
michael@0 | 6 | #define BASE_DIR_READER_POSIX_H_ |
michael@0 | 7 | #pragma once |
michael@0 | 8 | |
michael@0 | 9 | #include "build/build_config.h" |
michael@0 | 10 | |
michael@0 | 11 | // This header provides a class, DirReaderPosix, which allows one to open and |
michael@0 | 12 | // read from directories without allocating memory. For the interface, see |
michael@0 | 13 | // the generic fallback in dir_reader_fallback.h. |
michael@0 | 14 | |
michael@0 | 15 | // Mac note: OS X has getdirentries, but it only works if we restrict Chrome to |
michael@0 | 16 | // 32-bit inodes. There is a getdirentries64 syscall in 10.6, but it's not |
michael@0 | 17 | // wrapped and the direct syscall interface is unstable. Using an unstable API |
michael@0 | 18 | // seems worse than falling back to enumerating all file descriptors so we will |
michael@0 | 19 | // probably never implement this on the Mac. |
michael@0 | 20 | |
michael@0 | 21 | #if defined(OS_LINUX) |
michael@0 | 22 | #include "base/dir_reader_linux.h" |
michael@0 | 23 | #elif defined(OS_BSD) && !defined(__GLIBC__) |
michael@0 | 24 | #include "base/dir_reader_bsd.h" |
michael@0 | 25 | #else |
michael@0 | 26 | #include "base/dir_reader_fallback.h" |
michael@0 | 27 | #endif |
michael@0 | 28 | |
michael@0 | 29 | namespace base { |
michael@0 | 30 | |
michael@0 | 31 | #if defined(OS_LINUX) |
michael@0 | 32 | typedef DirReaderLinux DirReaderPosix; |
michael@0 | 33 | #elif defined(OS_BSD) && !defined(__GLIBC__) |
michael@0 | 34 | typedef DirReaderBSD DirReaderPosix; |
michael@0 | 35 | #else |
michael@0 | 36 | typedef DirReaderFallback DirReaderPosix; |
michael@0 | 37 | #endif |
michael@0 | 38 | |
michael@0 | 39 | } // namespace base |
michael@0 | 40 | |
michael@0 | 41 | #endif // BASE_DIR_READER_POSIX_H_ |