diff options
author | Michael Kerrisk <mtk.manpages@gmail.com> | 2016-03-10 02:51:53 +0100 |
---|---|---|
committer | Michael Kerrisk <mtk.manpages@gmail.com> | 2016-03-10 02:57:14 +0100 |
commit | 207f4520b8f12ba8c292443f02f51267a4aed721 (patch) | |
tree | 045c5e0a4dd3311471d1113013887d7ce03e2aa0 | |
parent | 8cd11c4293decc047d74f2e25cdfd0c9ec60c1dd (diff) | |
download | man-pages-207f4520b8f12ba8c292443f02f51267a4aed721.tar.gz |
open_memstream.3: Minor reworking
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
-rw-r--r-- | man3/open_memstream.3 | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/man3/open_memstream.3 b/man3/open_memstream.3 index 715ca43b45..965f4f5093 100644 --- a/man3/open_memstream.3 +++ b/man3/open_memstream.3 @@ -42,8 +42,9 @@ _GNU_SOURCE .SH DESCRIPTION The .BR open_memstream () -function opens a stream for writing to a buffer. -The function dynamically allocates the buffer, growing it as required. +function opens a stream for writing to a memory buffer. +The function dynamically allocates the buffer, +and the buffer automatically grows as needed. Initially, the buffer has a size of zero. After closing the stream, the caller should .BR free (3) @@ -53,21 +54,17 @@ The locations pointed to by .IR ptr and .I sizeloc -are used to report the current location and size of the buffer. -When the stream is closed -.RB ( fclose (3)) -or flushed -.RB ( fflush (3)), -the locations pointed to by -.I ptr -and -.I sizeloc -are updated to contain, respectively, a pointer to the buffer and the -current size of the buffer. +are used to report, respectively, +the current location and the size of the buffer. +The locations referred to by these pointers are updated +each time the stream is flushed +.RB ( fflush (3)) +and when the stream is closed +.RB ( fclose (3)). These values remain valid only as long as the caller performs no further output on the stream. If further output is performed, then the stream -must again be flushed before trying to access these variables. +must again be flushed before trying to access these values. A null byte is maintained at the end of the buffer. This byte is @@ -84,7 +81,7 @@ or .BR fseeko (3). Moving the buffer position past the end of the data already written fills the intervening space with -zeros. +null characters. The .BR open_wmemstream () |