[PATCH] D33895: [Support] Add TempFailureRetry helper function

Pavel Labath via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 5 07:24:38 PDT 2017


labath created this revision.
Herald added a subscriber: mgorny.

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.


https://reviews.llvm.org/D33895

Files:
  include/llvm/Support/Errno.h
  lib/Support/MemoryBuffer.cpp
  lib/Support/Unix/Path.inc
  lib/Support/Unix/Process.inc
  unittests/Support/CMakeLists.txt
  unittests/Support/ErrnoTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33895.101404.patch
Type: text/x-patch
Size: 5736 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170605/fbe7b2c6/attachment.bin>


More information about the llvm-commits mailing list