aboutsummaryrefslogtreecommitdiff
path: root/src/lib/fs
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-07-10 20:18:20 -0400
committerNick Mathewson <nickm@torproject.org>2018-07-10 20:18:20 -0400
commitc90961a9233e7287605886585503ee94d13a4592 (patch)
treefa7c389dbd702be1925dcf4a5144159ff23bedda /src/lib/fs
parent391ef5e42cc79982a28aaaf22e9f9b255f6910d3 (diff)
downloadtor-c90961a9233e7287605886585503ee94d13a4592.tar.gz
tor-c90961a9233e7287605886585503ee94d13a4592.zip
Document compat_getdelim_.
Diffstat (limited to 'src/lib/fs')
-rw-r--r--src/lib/fs/files.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/lib/fs/files.h b/src/lib/fs/files.h
index d219e3cf05..2ee1b20149 100644
--- a/src/lib/fs/files.h
+++ b/src/lib/fs/files.h
@@ -104,6 +104,9 @@ char *read_file_to_str_until_eof(int fd, size_t max_bytes_to_read,
ATTR_MALLOC;
#if !defined(HAVE_GETDELIM) || defined(TOR_UNIT_TESTS)
+/** Internal back-end function to implement getdelim(): only exists when
+ * Tor is built for unit tests, or when Tor is built on an operating system
+ * without its own getdelim(). */
ssize_t compat_getdelim_(char **lineptr, size_t *n, int delim, FILE *stream);
#endif
@@ -112,6 +115,8 @@ ssize_t compat_getdelim_(char **lineptr, size_t *n, int delim, FILE *stream);
* Cross-platform wrapper for getdelim(): behaves as the POSIX-standard
* getdelim() function.
*
+ * See `getdelim(3)` for more information.
+ *
* Note that this function will use the libc memory allocator -- so any memory
* passed to this function must come from raw_malloc(), and must be freed by
* raw_free() -- don't use tor_malloc() and tor_free() with this.