Runs first in every process of this image, role children included: they * fork too. Windows has neither fork nor an interposable _exit here. */
| 1629 | /* Runs first in every process of this image, role children included: they |
| 1630 | * fork too. Windows has neither fork nor an interposable _exit here. */ |
| 1631 | static void tf_coverage_process_init(void) { |
| 1632 | #ifndef _WIN32 |
| 1633 | /* Read before anything routes: tf_coverage_route puts a `%c` pattern into |
| 1634 | * the environment of a process that is not continuous itself. */ |
| 1635 | const char *initial = getenv("LLVM_PROFILE_FILE"); |
| 1636 | tf_coverage_continuous = initial != NULL && strstr(initial, "%c") != NULL; |
| 1637 | if (!tf_coverage_atfork_attempted) { |
| 1638 | tf_coverage_atfork_attempted = true; |
| 1639 | tf_coverage_atfork_status = pthread_atfork(NULL, NULL, tf_coverage_fork_child); |
| 1640 | } |
| 1641 | #endif |
| 1642 | } |
| 1643 | #endif /* CBM_TEST_COVERAGE */ |
| 1644 | |
| 1645 | static int g_suite_argc = 0; |