MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / asmjit_error_from_errno

Function asmjit_error_from_errno

lib/asmjit/asmjit/core/virtmem.cpp:393–414  ·  view source on GitHub ↗

Translates libc errors specific to VirtualMemory mapping to `asmjit::Error`.

Source from the content-addressed store, hash-verified

391
392// Translates libc errors specific to VirtualMemory mapping to `asmjit::Error`.
393[[maybe_unused]]
394static Error asmjit_error_from_errno(int e) noexcept {
395 switch (e) {
396 case EACCES:
397 case EAGAIN:
398 case ENODEV:
399 case EPERM:
400 return Error::kInvalidState;
401
402 case EFBIG:
403 case ENOMEM:
404 case EOVERFLOW:
405 return Error::kOutOfMemory;
406
407 case EMFILE:
408 case ENFILE:
409 return Error::kTooManyHandles;
410
411 default:
412 return Error::kInvalidArgument;
413 }
414}
415
416[[maybe_unused]]
417static MemoryFlags max_access_flags_to_regular_access_flags(MemoryFlags memory_flags) noexcept {

Callers 7

openMethod · 0.85
allocateMethod · 0.85
map_memoryFunction · 0.85
unmap_memoryFunction · 0.85
protectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected