Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Define TEMP_FAILURE_RETRY for non-glibc systems
  • Loading branch information
PureTryOut committed Mar 26, 2020
1 parent 665768e commit 3dc6816
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions profiled_config.h
Expand Up @@ -42,6 +42,16 @@ extern "C" {
} /* fool JED indentation ... */
#endif

/* Used to retry syscalls that can return EINTR. Taken from bionic */
#ifndef TEMP_FAILURE_RETRY
#define TEMP_FAILURE_RETRY(exp) ({ \
__typeof__(exp) _rc; \
do { \
_rc = (exp); \
} while (_rc == -1 && errno == EINTR); \
_rc; })
#endif

#ifdef __cplusplus
};
#endif
Expand Down

0 comments on commit 3dc6816

Please sign in to comment.