LLVM API Documentation
00001 //===- llvm/System/Unix/Unix.h - Common Unix Include File -------*- C++ -*-===// 00002 // 00003 // The LLVM Compiler Infrastructure 00004 // 00005 // This file was developed by Reid Spencer and is distributed under the 00006 // University of Illinois Open Source License. See LICENSE.TXT for details. 00007 // 00008 //===----------------------------------------------------------------------===// 00009 // 00010 // This file defines things specific to Unix implementations. 00011 // 00012 //===----------------------------------------------------------------------===// 00013 00014 //===----------------------------------------------------------------------===// 00015 //=== WARNING: Implementation here must contain only generic UNIX code that 00016 //=== is guaranteed to work on all UNIX variants. 00017 //===----------------------------------------------------------------------===// 00018 00019 #include "llvm/Config/config.h" // Get autoconf configuration settings 00020 #include <unistd.h> 00021 #include <cstdlib> 00022 #include <cstdio> 00023 #include <cstring> 00024 #include <cerrno> 00025 #include <sys/types.h> 00026 #include <sys/param.h> 00027 #include <assert.h> 00028 #include <string> 00029 00030 inline void ThrowErrno(const std::string& prefix) { 00031 char buffer[MAXPATHLEN]; 00032 throw prefix + ": " + strerror(errno); 00033 }