FMEMOPEN(3) Linux Programmer's Manual FMEMOPEN(3)
fmemopen, open_memstream, open_wmemstream - open memory as stream
FILE *fmemopen(void *buf, size_t size, const char *mode);
FILE *open_memstream(char **ptr, size_t *sizeloc);
FILE *open_wmemstream(wchar_t **ptr, size_t *sizeloc);
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
fmemopen(), open_memstream(), open_wmemstream():
Since glibc 2.10:
_XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L
Before glibc 2.10:
The fmemopen() function opens a stream that permits the access specified by mode. The stream allows I/O to be performed on the string or
memory buffer pointed to by buf. This buffer must be at least size bytes long.
The argument mode is the same as for fopen(3). If mode specifies an append mode, then the initial file position is set to the location of
the first null byte ('