File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,23 +48,32 @@ and sets how it will be released when
4848is called. The
4949.I how
5050parameter 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
5666The 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
6170is 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 .
6372The reentrant form
6473.B auplugin_setvbuf_r
6574operates 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
7079returns -1 on error, 0 when no data is available, or the number of characters copied otherwise.
You can’t perform that action at this time.
0 commit comments