*** UNIX MANUAL PAGE BROWSER ***

A Nergahak database for man pages research.

Navigation

Directory Browser

1Browse 4.4BSD4.4BSD
1Browse Digital UNIXDigital UNIX 4.0e
1Browse FreeBSDFreeBSD 14.3
1Browse MINIXMINIX 3.4.0rc6-d5e4fc0
1Browse NetBSDNetBSD 10.1
1Browse OpenBSDOpenBSD 7.7
1Browse UNIX v7Version 7 UNIX
1Browse UNIX v10Version 10 UNIX

Manual Page Search

Manual Page Result

0 Command: open_memstream | Section: 3 | Source: OpenBSD | File: open_memstream.3
OPEN_MEMSTREAM(3) FreeBSD Library Functions Manual OPEN_MEMSTREAM(3) NAME open_memstream, open_wmemstream - open a memory buffer stream SYNOPSIS #include <stdio.h> FILE * open_memstream(char **pbuf, size_t *psize); #include <wchar.h> FILE * open_wmemstream(wchar_t **pbuf, size_t *psize); DESCRIPTION The open_memstream() and 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. RETURN VALUES Upon successful completion, open_memstream() and open_wmemstream() return a FILE pointer. Otherwise, NULL is returned and the global variable errno is set to indicate the error. ERRORS [EINVAL] The pbuf or the psize argument is NULL. The open_memstream() and open_wmemstream() functions may also fail and set errno for any of the errors specified for the routine malloc(3). SEE ALSO fmemopen(3), fopen(3), funopen(3), malloc(3) STANDARDS The functions open_memstream() and open_wmemstream(), conform to IEEE Std 1003.1-2008 ("POSIX.1"). HISTORY The open_memstream() and open_wmemstream() functions first appeared in OpenBSD 5.4. FreeBSD 14.1-RELEASE-p8 June 5, 2013 FreeBSD 14.1-RELEASE-p8

Navigation Options