llvm-6502/lib/Support/Windows
David Majnemer 220c5ca8f4 Support: Don't call close again if we get EINTR
Most Unix-like operating systems guarantee that the file descriptor is
closed after a call to close(2), even if close comes back with EINTR.
For these systems, calling close _again_ will either do nothing or close
some other file descriptor open(2)'d by another thread. (Linux)

However, some operating systems do not have this behavior.  They require
at least another call to close(2) before guaranteeing that the
descriptor is closed. (HP-UX)

And some operating systems have an unpredictable blend of the two
behaviors! (xnu)

Avoid this disaster by blocking all signals before we call close(2).
This ensures that a signal will not be delivered to the thread and
close(2) will not give us back EINTR.  We restore the signal mask once
the operation is done.

N.B. This isn't a problem on Windows, it doesn't have a notion of EINTR
because signals always get delivered to dedicated signal handling
threads.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219189 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-07 05:48:40 +00:00
..
DynamicLibrary.inc Windows/DynamicLibrary.inc: Remove 'extern "C"' in ELM_Callback. 2014-09-23 01:09:46 +00:00
explicit_symbols.inc
Host.inc Windows/Host.inc: Reformat the header to fit 80-col. 2014-09-24 04:45:14 +00:00
Memory.inc Remove 'using std::errro_code' from lib. 2014-06-13 02:24:39 +00:00
Mutex.inc Rename Windows.h to WindowsSupport.h to avoid ambiguity 2014-02-12 21:26:20 +00:00
Path.inc Misc cleanups to the FileSytem api. 2014-09-11 20:30:02 +00:00
Process.inc Support: Don't call close again if we get EINTR 2014-10-07 05:48:40 +00:00
Program.inc clang-format of ChangeStdinToBinary & ChangeStdoutToBinary. 2014-09-26 22:27:11 +00:00
RWMutex.inc Rename Windows.h to WindowsSupport.h to avoid ambiguity 2014-02-12 21:26:20 +00:00
Signals.inc Use simpler form of llvm::sys::fs::remove. 2014-02-23 13:37:37 +00:00
ThreadLocal.inc Fix a -Wunused-local-typedefs warning 2014-07-14 22:46:45 +00:00
TimeValue.inc Use raw_ostream and Format.h on Windows so that we don't have to roll 2014-04-28 01:57:46 +00:00
Watchdog.inc Add a new watchdog timer interface. The interface does not permit handling timeouts, so 2013-03-26 01:27:52 +00:00
WindowsSupport.h Add writeFileWithSystemEncoding to LibLLVMSuppor. 2014-09-03 20:02:00 +00:00