| 51 | } |
| 52 | |
| 53 | static void |
| 54 | restore_rlimit_float_settings() |
| 55 | { |
| 56 | fesetenv(&envp); |
| 57 | fesetround(roundingMode); |
| 58 | |
| 59 | struct rlimit rlim = {0, 0}; |
| 60 | |
| 61 | #define RESTORE_RLIMIT(_RLIMIT, _rlim_cur) \ |
| 62 | if (_rlim_cur != RLIM_INFINITY) { \ |
| 63 | getrlimit(_RLIMIT, &rlim); \ |
| 64 | if (_rlim_cur <= rlim.rlim_max) { \ |
| 65 | rlim.rlim_cur = _rlim_cur; \ |
| 66 | JASSERT(setrlimit(_RLIMIT, &rlim) == 0) (JASSERT_ERRNO); \ |
| 67 | } else { \ |
| 68 | JTRACE("Prev. soft limit of " #_RLIMIT " lowered to new hard limit") \ |
| 69 | (_rlim_cur) (rlim.rlim_max); \ |
| 70 | _rlim_cur = rlim.rlim_max; \ |
| 71 | } \ |
| 72 | } |
| 73 | |
| 74 | RESTORE_RLIMIT(RLIMIT_AS, rlim_cur_as); |
| 75 | RESTORE_RLIMIT(RLIMIT_CORE, rlim_cur_core); |
| 76 | RESTORE_RLIMIT(RLIMIT_CPU, rlim_cur_cpu); |
| 77 | RESTORE_RLIMIT(RLIMIT_DATA, rlim_cur_data); |
| 78 | RESTORE_RLIMIT(RLIMIT_FSIZE, rlim_cur_fsize); |
| 79 | RESTORE_RLIMIT(RLIMIT_NICE, rlim_cur_nice); |
| 80 | RESTORE_RLIMIT(RLIMIT_NOFILE, rlim_cur_nofile); |
| 81 | RESTORE_RLIMIT(RLIMIT_NPROC, rlim_cur_nproc); |
| 82 | RESTORE_RLIMIT(RLIMIT_STACK, rlim_cur_stack); |
| 83 | } |
| 84 | |
| 85 | static void |
| 86 | rlimitfloat_EventHook(DmtcpEvent_t event, DmtcpEventData_t *data) |
no outgoing calls
no test coverage detected