OSDN Git Service

Revert "[Support] Add RetryAfterSignal helper function" and subsequent fix
[android-x86/external-llvm.git] / include / llvm / Support / Errno.h
1 //===- llvm/Support/Errno.h - Portable+convenient errno handling -*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file declares some portable and convenient functions to deal with errno.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef LLVM_SUPPORT_ERRNO_H
15 #define LLVM_SUPPORT_ERRNO_H
16
17 #include <cerrno>
18 #include <string>
19
20 namespace llvm {
21 namespace sys {
22
23 /// Returns a string representation of the errno value, using whatever
24 /// thread-safe variant of strerror() is available.  Be sure to call this
25 /// immediately after the function that set errno, or errno may have been
26 /// overwritten by an intervening call.
27 std::string StrError();
28
29 /// Like the no-argument version above, but uses \p errnum instead of errno.
30 std::string StrError(int errnum);
31
32 }  // namespace sys
33 }  // namespace llvm
34
35 #endif  // LLVM_SYSTEM_ERRNO_H