diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-06-11 04:34:41 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-06-11 04:34:41 +0000 |
commit | cd56acbb5a0c90b5568f73704b8f7c2cbc556e5a (patch) | |
tree | f132f38b786d759d4c3879c897a841db48996fd0 /lib/Support/Unix/Memory.inc | |
parent | 9c7ddf73738c8384808837208ba4ec5518b44d32 (diff) | |
download | llvm-cd56acbb5a0c90b5568f73704b8f7c2cbc556e5a.tar.gz llvm-cd56acbb5a0c90b5568f73704b8f7c2cbc556e5a.tar.bz2 llvm-cd56acbb5a0c90b5568f73704b8f7c2cbc556e5a.tar.xz |
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
Diffstat (limited to 'lib/Support/Unix/Memory.inc')
-rw-r--r-- | lib/Support/Unix/Memory.inc | 8 |
1 files changed, 4 insertions, 4 deletions
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); |