Commit Graph

24 Commits

Author SHA1 Message Date
Jeffrey Yasskin
ed1c0ffe0b Add a portable strerror*() wrapper, llvm::sys::StrError(). This includes the
Windows variant, strerror_s, but I couldn't test that.

I'll update configure and config.h.in in a subsequent patch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74621 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-01 18:11:20 +00:00
Dan Gohman
070c42f311 glibc has two versions of strerror_r, a standards compliant one and a GNU
specific one. The GNU one is chosen when _GNU_SOURCE is defined. g++ always
defines _GNU_SOURCE on linux platforms because glibc's headers won't compile
in C++ mode without it. The GNU strerror_r doesn't always modify the buffer
which causes empty error messages on linux.

This patch changes MakeErrMsg to use the return value of strerror_r to get
the string instead of assuming the buffer will be modified, on GLIBC.

Patch by Benjamin Kramer!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73396 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-15 18:05:46 +00:00
Daniel Dunbar
a7f2a9e69f Make Unix.h:MakeErrMsg separate the prefix and errno string, so we get:
clang: error: unable to make temporary file: /etc/cc: can't make
  unique filename: Permission denied

instead of 

  clang: error: unable to make temporary file: /etc/cc: can't make
  unique filenamePermission denied

for example.

Also, audited the uses of MakeErrMsg to make the prefix strings
consistent (not end with newline/punctuation/space/": ").


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69626 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-20 20:50:13 +00:00
Dan Gohman
844731a7f1 Clean up the use of static and anonymous namespaces. This turned up
several things that were neither in an anonymous namespace nor static
but not intended to be global.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51017 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-13 00:00:25 +00:00
Chris Lattner
4ee451de36 Remove attribution from file headers, per discussion on llvmdev.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45418 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-29 20:36:04 +00:00
Reid Spencer
0554575567 For PR797:
Make the Win32 code exception free (untested/uncompiled) which forced some
interface changes which had ripple effect. This should be the last of 797.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29884 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-25 21:37:17 +00:00
Reid Spencer
51c5a286ba For PR797:
Final removal of exceptions from lib/System and adjustment of users to
accommodate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29846 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-23 20:34:57 +00:00
Reid Spencer
5a060775da For PR797:
Eliminate exception throwing from Path::renamePathOnDisk and adjust its
users correspondingly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29843 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-23 07:30:48 +00:00
Reid Spencer
4ce5dc6377 For PR797:
Remove all exception code from Program.inc and implement its new interface
with an ErrMsg string argument.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29790 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-21 06:02:44 +00:00
Chris Lattner
bed22d8902 Change AllocateRWX/DeallocateRWX to not throw an exception.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29058 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-07 17:32:37 +00:00
Misha Brukman
f976c856fc Remove trailing whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21422 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-21 22:55:34 +00:00
Reid Spencer
03aee2e3f2 For Bug 543:
Allow the ThrowErrno function to optionally accept an error number
parameter so that callers can specify the error number to be used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21384 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-21 02:30:32 +00:00
Chris Lattner
0798056b28 Fix a bug in my previous change to this, which broke the build on sparcs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20184 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-14 21:42:10 +00:00
Chris Lattner
946af52687 If errno is zero strerror_r does not modify the buffer, leaving it unterminated.
This causes garbage to be printed out after error messages.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20165 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-13 22:46:37 +00:00
Reid Spencer
7c1e2f96cd For PR351:
* Ensure #includes are wrapped with appropriate HAVE_ guards
* Account for variations in time.h and sys/time.h inclusion.
* Add macros for getting wait(2) exit status correctly (per autoconf sugg.)
* Implement ThrowErrno in terms of strerror_r, strerror or none based on
  what is available on the platform.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19161 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-27 06:17:50 +00:00
Chris Lattner
194ca80fdb Make this work with the ICC compiler, contributed by Bjørn Wennberg
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18626 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-08 16:10:52 +00:00
Reid Spencer
64a10ce9ad Forget strerror_r, it causes problems. Fix later when threading matters
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17783 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-14 22:10:54 +00:00
Reid Spencer
f348ccca80 Adjust sys/stat.h inclusion so its only for SunOS.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16686 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-05 00:56:46 +00:00
Tanya Lattner
c5a0bbfbeb Added a couple of includes to get this to compile on Sparc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16685 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-05 00:51:26 +00:00
Reid Spencer
551ccae044 Changes For Bug 352
Move include/Config and include/Support into include/llvm/Config,
include/llvm/ADT and include/llvm/Support. From here on out, all LLVM
public header files must be under include/llvm/.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16137 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-01 22:55:40 +00:00
Reid Spencer
387e5ec502 Add a new abstraction, SysConfig for platform independent system
configuration calls. Right now this just contains PreventCoreFiles so that
bugpoint can by platform independent.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16124 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-31 17:43:29 +00:00
Reid Spencer
b60bf6171d Add inclusion of assert.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16118 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-30 16:03:54 +00:00
Reid Spencer
c3de952426 Include some additional header files.
Fix the banner length.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16086 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-29 19:24:20 +00:00
Reid Spencer
b89a2237ea Initial implementation of the Path operating system concept.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16048 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-25 06:20:07 +00:00