summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2021-02-24 09:22:31 -0700
committerJens Axboe <axboe@kernel.dk>2021-02-24 09:22:31 -0700
commit965bae440af1d846d94765c12da2246e7fcaf9db (patch)
tree93eb2c1e4bd53cda62bdec00021dcc0af83cdf36
parent3512f9afc5538f1ddaa02f956527effccc089cb7 (diff)
parentb375a332b2aed1222ce18a1040f4229ee94b9cfa (diff)
downloadliburing-965bae440af1d846d94765c12da2246e7fcaf9db.tar.gz
liburing-965bae440af1d846d94765c12da2246e7fcaf9db.tar.bz2
Merge branch 'test-io-after-child-exit' of https://github.com/anarazel/liburing
* 'test-io-after-child-exit' of https://github.com/anarazel/liburing: tests: add test for using ring after a forked child exits.
-rw-r--r--test/across-fork.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/across-fork.c b/test/across-fork.c
index 14ee93a..009fe52 100644
--- a/test/across-fork.c
+++ b/test/across-fork.c
@@ -220,6 +220,13 @@ int main(int argc, char *argv[])
if (wait_cqe(&shmem->ring, "p cqe 2"))
goto errcleanup;
+ /* check that IO can still be submitted after child exited */
+ if (submit_write(&shmem->ring, shared_fd, "parent: write shared fd after child exit\n", 0))
+ goto errcleanup;
+
+ if (wait_cqe(&shmem->ring, "p cqe 3"))
+ goto errcleanup;
+
break;
}
case 0: {
@@ -260,7 +267,8 @@ int main(int argc, char *argv[])
if (verify_file(tmpdir, "shared",
"before fork: write shared fd\n"
"parent: write shared fd\n"
- "child: write shared fd\n") ||
+ "child: write shared fd\n"
+ "parent: write shared fd after child exit\n") ||
verify_file(tmpdir, "parent1", "parent: write parent fd 1\n") ||
verify_file(tmpdir, "parent2", "parent: write parent fd 2\n") ||
verify_file(tmpdir, "child", "child: write child fd\n"))