diff options
author | Elliott Hughes <enh@google.com> | 2013-03-06 16:20:55 -0800 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2013-03-06 16:20:55 -0800 |
commit | 6b3f49a5374305ce9690c3c5ca2aadc90f54c521 (patch) | |
tree | 7dcd0542e0e59e974bb6aae6a2c861e38f7d5dd1 /tests/stdio_test.cpp | |
parent | db794197cc880e3805bcefbea780476a359066c2 (diff) |
Upgrade to current NetBSD popen/pclose.
This gets us back to using vfork now our ARM vfork assembler stub is
fixed, and adds the missing thread safety for the 'pidlist'.
Bug: 5335385
Change-Id: Ib08bfa65b2cb9fa695717aae629ea14816bf988d
Diffstat (limited to 'tests/stdio_test.cpp')
-rw-r--r-- | tests/stdio_test.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/stdio_test.cpp b/tests/stdio_test.cpp index 196c725aa..7569d04fe 100644 --- a/tests/stdio_test.cpp +++ b/tests/stdio_test.cpp @@ -185,3 +185,15 @@ TEST(stdio, printf_ssize_t) { snprintf(buf, sizeof(buf), "%zd", v); #endif } + +TEST(stdio, popen) { + FILE* fp = popen("cat /proc/version", "r"); + ASSERT_TRUE(fp != NULL); + + char buf[16]; + char* s = fgets(buf, sizeof(buf), fp); + buf[13] = '\0'; + ASSERT_STREQ("Linux version", s); + + ASSERT_EQ(0, pclose(fp)); +} |