A while ago (back in 2010), Eric Blake wrote an open_memstream replacement module for BSD variants:
http://osdir.com/ml/bug-gnulib-gnu/2010-04/msg00360.html What happened to it? I'm using this patch right now to make libguestfs run on Mac OS X 10.10, but it's a shame it hasn't been made part of gnulib. Any chance the idea could be resurrected? -- M.