Hi!
> +static void waiting_child(struct testcase_t *t)
> +{
> +     int dummy;
> +     read(t->pipefd[0], &dummy, 1);
> +}
> +
> +static void stopped_child(struct testcase_t *t)
> +{
> +     int dummy;
> +     kill(getpid(), SIGSTOP);
> +     read(t->pipefd[0], &dummy, 1);
> +}
> +
> +static void setup2(struct testcase_t *t)
> +{
> +     if (pipe(t->pipefd) == -1)
> +             tst_brkm(TBROK|TERRNO, cleanup, "pipe");
> +     makechild(t, waiting_child);

I wonder if it would be better to use the TST_CHECKPOINT() interface
that I have written to address synchronization issues.

Have you used pipes because you wanted to avoid tst_tmpdir() and the
FIFO that the code uses? Unfortunately the checkpoint interface must use
fifo instead of pipes to be usable for cases where the file descriptors
cannot be propagated to child because it does exec() right after
fork()... If that is the issue, I can rewrite the checkpoint interface
in a way that would allow either pipe or fifo depending on
initialization parameters.

-- 
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to