Skip to content

Commit 639a67f

Browse files
committed
update the auplugin_fgets man page
1 parent 5727e70 commit 639a67f

1 file changed

Lines changed: 17 additions & 8 deletions

File tree

docs/auplugin_fgets.3

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,23 +48,32 @@ and sets how it will be released when
4848
is called. The
4949
.I how
5050
parameter should be one of
51-
.B MEM_SELF_MANAGED,
52-
.B MEM_MALLOC,
53-
.B MEM_MMAP,
54-
or
55-
.B MEM_MMAP_FILE.
51+
.RS
52+
.TP 9
53+
.B MEM_SELF_MANAGED
54+
Internal buffer owned by fgets
55+
.TP
56+
.B MEM_MALLOC
57+
User-supplied malloc buffer; fgets frees it
58+
.TP
59+
.B MEM_MMAP
60+
User-supplied mmap buffer; fgets munmaps it
61+
.TP
62+
.B MEM_MMAP_FILE
63+
Read-only mmap file data
64+
.RE
65+
.IP
5666
The default is
5767
.B MEM_SELF_MANAGED
58-
which means no action is taken on the memory block.
59-
When
68+
which means its lifecycle is automatically handled. When
6069
.B MEM_MMAP_FILE
6170
is used, the buffer is treated as a preloaded buffer (the entire file) and no reads will be performed on the descriptor provided to
6271
.BR auplugin_fgets_r .
6372
The reentrant form
6473
.B auplugin_setvbuf_r
6574
operates on an explicit state handle.
6675
.PP
67-
These functions maintain static state and are therefore not thread safe.
76+
These functions maintain static state and are therefore not thread safe. For thread-safety, use the re-entrant variants.
6877
.SH RETURN VALUE
6978
.B auplugin_fgets
7079
returns -1 on error, 0 when no data is available, or the number of characters copied otherwise.

0 commit comments

Comments
 (0)