[#llvm-errnoAsErrorCode] = xref:llvm.adoc[llvm]::errnoAsErrorCode :relfileprefix: ../ :mrdocs: Helper to get errno as an std::error_code. == Synopsis Declared in `<llvm/Support/Error.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- std::error_code errnoAsErrorCode(); ---- == Description errno should always be represented using the generic category as that's what both libc++ and libstdc++ do. On POSIX systems you can also represent them using the system category, however this makes them compare differently for values outside of those used by `std::errc` if one is generic and the other is system. See the libc++ and libstdc++ implementations of `default_error_condition` on the system category for more details on what the difference is. == Return Value A std::error_code for the current errno. [.small]#Created with https://www.mrdocs.com[MrDocs]#