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
This commit is contained in:
Elliott Hughes
2013-03-06 16:20:55 -08:00
parent db794197cc
commit 6b3f49a537
6 changed files with 168 additions and 49 deletions

View File

@@ -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));
}