llvm-project/llvm/lib/Support/Unix
Pavel Labath fe09f506b6 Recommit "[Support] Add RetryAfterSignal helper function"
The difference from the previous version is the use of decltype, as the
implementation of std::result_of in libc++ did not work correctly for
variadic function like open(2).

Original summary:
This function retries an operation if it was interrupted by a signal
(failed with EINTR). It's inspired by the TEMP_FAILURE_RETRY macro in
glibc, but I've turned that into a template function. I've also added a
fail-value argument, to enable the function to be used with e.g.
fopen(3), which is documented to fail for any reason that open(2) can
fail (which includes EINTR).

The main user of this function will be lldb, but there were also a
couple of uses within llvm that I could simplify using this function.

Reviewers: zturner, silvas, joerg

Subscribers: mgorny, llvm-commits

Differential Revision: https://reviews.llvm.org/D33895

llvm-svn: 306671
2017-06-29 13:15:31 +00:00
..
COM.inc
DynamicLibrary.inc Close DynamicLibraries in reverse order they were opened. 2017-06-05 16:26:58 +00:00
Host.inc [CMake] Introduce LLVM_TARGET_TRIPLE_ENV as an option to override LLVM_DEFAULT_TARGET_TRIPLE at runtime. 2017-06-17 03:19:08 +00:00
Memory.inc Implement AllocateRWX and ReleaseRWX for NetBSD 2017-06-18 16:52:32 +00:00
Mutex.inc
Path.inc Recommit "[Support] Add RetryAfterSignal helper function" 2017-06-29 13:15:31 +00:00
Process.inc Recommit "[Support] Add RetryAfterSignal helper function" 2017-06-29 13:15:31 +00:00
Program.inc Support: chunk writing on Linux 2017-06-20 20:51:51 +00:00
README.txt
RWMutex.inc
Signals.inc Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
ThreadLocal.inc Revert "Fix Clang-tidy modernize-deprecated-headers warnings in remaining files; other minor fixes." 2016-04-05 20:45:04 +00:00
Threading.inc Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
Unix.h Remove TimeValue usage from llvm/Support 2016-10-24 10:59:17 +00:00
Watchdog.inc

README.txt

llvm/lib/Support/Unix README
===========================

This directory provides implementations of the lib/System classes that
are common to two or more variants of UNIX. For example, the directory
structure underneath this directory could look like this:

Unix           - only code that is truly generic to all UNIX platforms
  Posix        - code that is specific to Posix variants of UNIX
  SUS          - code that is specific to the Single Unix Specification
  SysV         - code that is specific to System V variants of UNIX

As a rule, only those directories actually needing to be created should be
created. Also, further subdirectories could be created to reflect versions of
the various standards. For example, under SUS there could be v1, v2, and v3
subdirectories to reflect the three major versions of SUS.