|OPEN_MEMSTREAM(3)||Library Functions Manual||OPEN_MEMSTREAM(3)|
open_wmemstream() functions create, respectively, a seekable byte-oriented or wide-oriented stream for writing. A dynamically allocated buffer, using malloc(3), is then wrapped to the pointer referenced by pbuf and grows automatically as required.
When the stream is either closed or flushed, the address of the buffer is stored in the pointer referenced by pbuf. At the same time the smaller of the current position and the buffer length is written in the variable pointed to by psize. This value represents, respectively, the number of bytes or wide characters contained in the buffer, not including the terminating null character.
The buffer memory should be released after the stream is closed.
open_wmemstream() return a
NULLis returned and the global variable errno is set to indicate the error.
open_wmemstream() functions may also fail and set
errno for any of the errors specified for the routine
open_wmemstream(), conform to IEEE Std 1003.1-2008 (“POSIX.1”).
open_wmemstream() functions first appeared in OpenBSD 5.4.
|June 5, 2013||OpenBSD-current|