* util.cxx (stap_system_read): Use gnu's stdio_filebuf to read directly
from the pipe file descriptor.
#include <string>
#include <fstream>
#include <cassert>
+#include <ext/stdio_filebuf.h>
extern "C" {
#include <fcntl.h>
}
using namespace std;
+using namespace __gnu_cxx;
// Return current users home directory or die.
spawned_pids.insert(child);
// read everything from the child
- string readpath = "/proc/self/fd/" + lex_cast(pfd[0]);
- ifstream in(readpath.c_str());
- close(pfd[0]);
+ stdio_filebuf<char> in(pfd[0], ios_base::in);
close(pfd[1]);
- out << in.rdbuf();
+ out << ∈
return stap_waitpid(verbose, child);
}