From cd56acbb5a0c90b5568f73704b8f7c2cbc556e5a Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Wed, 11 Jun 2014 04:34:41 +0000 Subject: Uses generic_category instead of system_category. Some c++ libraries (libstdc++ at least) don't seem to map to the generic category in in the system_category's default_error_condition. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210635 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Support/Unix/Memory.inc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/Support/Unix/Memory.inc') diff --git a/lib/Support/Unix/Memory.inc b/lib/Support/Unix/Memory.inc index 7e02244c72..5d19f59bc7 100644 --- a/lib/Support/Unix/Memory.inc +++ b/lib/Support/Unix/Memory.inc @@ -95,7 +95,7 @@ Memory::allocateMappedMemory(size_t NumBytes, #ifdef NEED_DEV_ZERO_FOR_MMAP static int zero_fd = open("/dev/zero", O_RDWR); if (zero_fd == -1) { - EC = error_code(errno, system_category()); + EC = error_code(errno, generic_category()); return MemoryBlock(); } fd = zero_fd; @@ -123,7 +123,7 @@ Memory::allocateMappedMemory(size_t NumBytes, if (NearBlock) //Try again without a near hint return allocateMappedMemory(NumBytes, nullptr, PFlags, EC); - EC = error_code(errno, system_category()); + EC = error_code(errno, generic_category()); return MemoryBlock(); } @@ -143,7 +143,7 @@ Memory::releaseMappedMemory(MemoryBlock &M) { return error_code(); if (0 != ::munmap(M.Address, M.Size)) - return error_code(errno, system_category()); + return error_code(errno, generic_category()); M.Address = nullptr; M.Size = 0; @@ -163,7 +163,7 @@ Memory::protectMappedMemory(const MemoryBlock &M, unsigned Flags) { int Result = ::mprotect(M.Address, M.Size, Protect); if (Result != 0) - return error_code(errno, system_category()); + return error_code(errno, generic_category()); if (Flags & MF_EXEC) Memory::InvalidateInstructionCache(M.Address, M.Size); -- cgit v1.2.3