ltrace/tests/Sanity/random-apps/vfork.c
Václav Kadlčík 0554fda54f Import RHEL's test Sanity/random-apps
Note than several sub-tests (apps) had to be removed as unsuitable
for publishing.
2021-08-17 16:31:24 +00:00

16 lines
304 B
C

#define _GNU_SOURCE
#include <unistd.h>
#include <stdio.h>
int main (void)
{
pid_t child = vfork ();
/* PRINTF/SLEEP violate the VFORK operations restriction. */
printf ("%d pid=%d\n", (int) child, (int) getpid ());
sleep (1);
if (!child)
execlp ("/bin/true", "/bin/true", NULL);
return 0;
}