FMEMOPEN(3) Linux Programmer's Manual FMEMOPEN(3)
NAME
fmemopen, open_memstream, open_wmemstream - open memory as stream
SYNOPSIS
#define _GNU_SOURCE
#include <stdio.h>
FILE *fmemopen(void *buf, size_t size, const char *mode);
FILE *open_memstream(char **ptr, size_t *sizeloc);
#define _GNU_SOURCE
#include <wchar.h>
FILE *open_wmemstream(wchar_t **ptr, size_t *sizeloc);
DESCRIPTION
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 ('