Files
CMake/Tests/RunCMake/CTestTimeout/TestTimeout.c
T
Raul Tambre 3f7ebf9354 RunCMake/CTestTimeout: Include sched.h for pid_t
ISO C modes in Clang don't enable modern POSIX standards.
Include sched.h to define pid_t in such modes.
2022-06-27 20:34:53 +03:00

26 lines
317 B
C

#if defined(_WIN32)
# include <windows.h>
#else
# include <sched.h>
# include <unistd.h>
#endif
#include <stdio.h>
int main(void)
{
#ifdef FORK
pid_t pid = fork();
if (pid != 0) {
return 0;
}
#endif
#if defined(_WIN32)
Sleep((TIMEOUT + 4) * 1000);
#else
sleep((TIMEOUT + 4));
#endif
return 0;
}