1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/ipc/chromium/src/base/dir_reader_posix.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,41 @@ 1.4 +// Copyright (c) 2010 The Chromium Authors. All rights reserved. 1.5 +// Use of this source code is governed by a BSD-style license that can be 1.6 +// found in the LICENSE file. 1.7 + 1.8 +#ifndef BASE_DIR_READER_POSIX_H_ 1.9 +#define BASE_DIR_READER_POSIX_H_ 1.10 +#pragma once 1.11 + 1.12 +#include "build/build_config.h" 1.13 + 1.14 +// This header provides a class, DirReaderPosix, which allows one to open and 1.15 +// read from directories without allocating memory. For the interface, see 1.16 +// the generic fallback in dir_reader_fallback.h. 1.17 + 1.18 +// Mac note: OS X has getdirentries, but it only works if we restrict Chrome to 1.19 +// 32-bit inodes. There is a getdirentries64 syscall in 10.6, but it's not 1.20 +// wrapped and the direct syscall interface is unstable. Using an unstable API 1.21 +// seems worse than falling back to enumerating all file descriptors so we will 1.22 +// probably never implement this on the Mac. 1.23 + 1.24 +#if defined(OS_LINUX) 1.25 +#include "base/dir_reader_linux.h" 1.26 +#elif defined(OS_BSD) && !defined(__GLIBC__) 1.27 +#include "base/dir_reader_bsd.h" 1.28 +#else 1.29 +#include "base/dir_reader_fallback.h" 1.30 +#endif 1.31 + 1.32 +namespace base { 1.33 + 1.34 +#if defined(OS_LINUX) 1.35 +typedef DirReaderLinux DirReaderPosix; 1.36 +#elif defined(OS_BSD) && !defined(__GLIBC__) 1.37 +typedef DirReaderBSD DirReaderPosix; 1.38 +#else 1.39 +typedef DirReaderFallback DirReaderPosix; 1.40 +#endif 1.41 + 1.42 +} // namespace base 1.43 + 1.44 +#endif // BASE_DIR_READER_POSIX_H_