LLVM API Documentation

Errno.h
Go to the documentation of this file.
00001 //===- llvm/Support/Errno.h - Portable+convenient errno handling -*- C++ -*-===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // This file declares some portable and convenient functions to deal with errno.
00011 //
00012 //===----------------------------------------------------------------------===//
00013 
00014 #ifndef LLVM_SUPPORT_ERRNO_H
00015 #define LLVM_SUPPORT_ERRNO_H
00016 
00017 #include <string>
00018 
00019 namespace llvm {
00020 namespace sys {
00021 
00022 /// Returns a string representation of the errno value, using whatever
00023 /// thread-safe variant of strerror() is available.  Be sure to call this
00024 /// immediately after the function that set errno, or errno may have been
00025 /// overwritten by an intervening call.
00026 std::string StrError();
00027 
00028 /// Like the no-argument version above, but uses \p errnum instead of errno.
00029 std::string StrError(int errnum);
00030 
00031 }  // namespace sys
00032 }  // namespace llvm
00033 
00034 #endif  // LLVM_SYSTEM_ERRNO_H