FileSystem.inc revision 5460a1f25d9ddecb5c70667267d66d51af177a99
1//===- FileSystem.inc -----------------------------------------------------===// 2// 3// The MCLinker Project 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// 9#include <string> 10#include <sys/types.h> 11#include <sys/stat.h> 12#include <fcntl.h> 13 14namespace mcld{ 15namespace sys{ 16namespace fs{ 17namespace detail{ 18 19std::string static_library_extension = ".a"; 20std::string shared_library_extension = ".so"; 21std::string executable_extension = ""; 22std::string relocatable_extension = ".o"; 23std::string assembly_extension = ".s"; 24std::string bitcode_extension = ".bc"; 25 26size_t pread(int pFD, Address pBuf, size_t pCount, off_t pOffset) 27{ 28 return ::pread(pFD, (void*) pBuf, pCount, pOffset); 29} 30 31size_t pwrite(int pFD, const Address pBuf, size_t pCount, off_t pOffset) 32{ 33 return ::pwrite(pFD, (const void*) pBuf, pCount, pOffset); 34} 35 36char *strerror(int errnum) 37{ 38 return ::strerror(errnum); 39} 40 41} // namespace of detail 42} // namespace of fs 43} // namespace of sys 44} // namespace of mcld 45 46