Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/kernel add on more synchronization point



details:   https://anonhg.NetBSD.org/src/rev/69d7a5488420
branches:  trunk
changeset: 348876:69d7a5488420
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Nov 12 20:56:49 2016 +0000

description:
add on more synchronization point

diffstat:

 tests/kernel/t_ptrace_wait.c |  11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diffs (40 lines):

diff -r f9d85be088c4 -r 69d7a5488420 tests/kernel/t_ptrace_wait.c
--- a/tests/kernel/t_ptrace_wait.c      Sat Nov 12 20:03:53 2016 +0000
+++ b/tests/kernel/t_ptrace_wait.c      Sat Nov 12 20:56:49 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_ptrace_wait.c,v 1.10 2016/11/12 20:03:53 christos Exp $      */
+/*     $NetBSD: t_ptrace_wait.c,v 1.11 2016/11/12 20:56:49 christos Exp $      */
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_ptrace_wait.c,v 1.10 2016/11/12 20:03:53 christos Exp $");
+__RCSID("$NetBSD: t_ptrace_wait.c,v 1.11 2016/11/12 20:56:49 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -860,8 +860,11 @@
 
                printf("Parent should now attach to tracee\n");
 
+               /* Write to pearent we are ok */
+               rv = write(fds_fromtracee[1], &msg, sizeof(msg));
+               FORKEE_ASSERT(rv == sizeof(msg));
                /* Wait for message from the parent */
-               rv = write(fds_fromtracee[1], &msg, sizeof(msg));
+               rv = read(fds_totracee[0], &msg, sizeof(msg));
                FORKEE_ASSERT(rv == sizeof(msg));
 
                _exit(exitval_tracee);
@@ -895,6 +898,8 @@
        printf("Let the tracee exit now\n");
        rv = read(fds_fromtracee[0], &msg, sizeof(msg));
        ATF_REQUIRE(rv == sizeof(msg));
+       rv = write(fds_totracee[1], &msg, sizeof(msg));
+       ATF_REQUIRE(rv == sizeof(msg));
 
        printf("Wait for tracee to exit with %s()\n", TWAIT_FNAME);
        TWAIT_REQUIRE_SUCCESS(



Home | Main Index | Thread Index | Old Index