This recent Stack Overflow question turned up a recommendaton to invoke undefined behavior in the fmemopen man page: http://stackoverflow.com/questions/38854163/using-rewind-on-a-file-opened-with-fmemopen The stdio buffer associated with the fmemopen-obtained FILE, and the output memory buffer into which it's writing, are conceptually distinct entities, and there is no reason to expect reasonable results if you modify the contents of a setvbuf-associated buffer through other means while it's associated with a FILE. The following text should simply be removed: Alternatively, the caller can explicitly set buf as the stdio stream buffer, at the same time informing stdio of the buffer's size, using: setbuffer(stream, buf, size); Rich -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html