1218885Sdim//===- llvm/Support/Errno.h - Portable+convenient errno handling -*- C++ -*-===// 2218885Sdim// 3218885Sdim// The LLVM Compiler Infrastructure 4218885Sdim// 5218885Sdim// This file is distributed under the University of Illinois Open Source 6218885Sdim// License. See LICENSE.TXT for details. 7218885Sdim// 8218885Sdim//===----------------------------------------------------------------------===// 9218885Sdim// 10218885Sdim// This file declares some portable and convenient functions to deal with errno. 11218885Sdim// 12218885Sdim//===----------------------------------------------------------------------===// 13218885Sdim 14249423Sdim#ifndef LLVM_SUPPORT_ERRNO_H 15249423Sdim#define LLVM_SUPPORT_ERRNO_H 16218885Sdim 17218885Sdim#include <string> 18218885Sdim 19218885Sdimnamespace llvm { 20218885Sdimnamespace sys { 21218885Sdim 22218885Sdim/// Returns a string representation of the errno value, using whatever 23218885Sdim/// thread-safe variant of strerror() is available. Be sure to call this 24218885Sdim/// immediately after the function that set errno, or errno may have been 25218885Sdim/// overwritten by an intervening call. 26218885Sdimstd::string StrError(); 27218885Sdim 28218885Sdim/// Like the no-argument version above, but uses \p errnum instead of errno. 29218885Sdimstd::string StrError(int errnum); 30218885Sdim 31218885Sdim} // namespace sys 32218885Sdim} // namespace llvm 33218885Sdim 34218885Sdim#endif // LLVM_SYSTEM_ERRNO_H 35