mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-03 18:13:01 +00:00
Fixes #276987. (Philippe Waroquiers, philippe.waroquiers@skynet.be) * make_local_links - disable gdb tests if gdb version < 7 - disable pic tests if gdb version < 7.1 * nlfork_chain test - reduce chain from 20 to 15 to avoid ENOMEM on small ARM systems * main_pic.c - put break at line 11 rather than main entry, as ARM gdb does not properly show main args till it has started executing. * passsigalrm.c - do not setsa.sa_restorer (obsolete on linux, unknown on darwin) * mcvabits.vgtest - make prereq consistent with other tests * filter_gdb - upgraded filter to new linenr in clean_after_fork.c git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11853
38 lines
623 B
C
38 lines
623 B
C
#include <stdlib.h>
|
|
#include <stdio.h>
|
|
#include <errno.h>
|
|
#include <unistd.h>
|
|
#include <sys/wait.h>
|
|
void fork_chain(int level)
|
|
{
|
|
int pid;
|
|
|
|
printf ("forking level %d\n", level);
|
|
fflush (stdout);
|
|
pid = fork();
|
|
if (pid == -1) {
|
|
perror("fork");
|
|
exit(1);
|
|
}
|
|
|
|
if (pid == 0) {
|
|
if (level > 0) {
|
|
fork_chain (level - 1);
|
|
}
|
|
} else {
|
|
int ret;
|
|
int status;
|
|
while((ret = waitpid(pid, &status, 0)) != pid) {
|
|
if (errno != EINTR) {
|
|
perror("waitpid");
|
|
exit(1);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
int main()
|
|
{
|
|
fork_chain (15);
|
|
return 0;
|
|
}
|