diff options
author | Andrew Clayton <a.clayton@nginx.com> | 2022-12-01 01:39:57 +0000 |
---|---|---|
committer | Andrew Clayton <a.clayton@nginx.com> | 2022-12-10 14:00:20 +0000 |
commit | 9466daf9bdafa3e00f521a47f4ce218353bf7f86 (patch) | |
tree | 5a2f0959af2a46f09f865511a54daca79034c491 /src/nxt_file.h | |
parent | 55b9a5307d705da91d3ef317639356c748853a7c (diff) | |
download | unit-9466daf9bdafa3e00f521a47f4ce218353bf7f86.tar.gz unit-9466daf9bdafa3e00f521a47f4ce218353bf7f86.tar.bz2 |
Added simple wrappers for fopen(3) and fclose(3).
Add simple wrapper functions for fopen(3) and fclose(3) that are
somewhat akin to the nxt_file_open() and nxt_file_close() wrappers that
log errors.
Suggested-by: Alejandro Colomar <alx@nginx.com>
Reviewed-by: Alejandro Colomar <alx@nginx.com>
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
Diffstat (limited to '')
-rw-r--r-- | src/nxt_file.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nxt_file.h b/src/nxt_file.h index 07c7a22b..945717b3 100644 --- a/src/nxt_file.h +++ b/src/nxt_file.h @@ -186,6 +186,10 @@ NXT_EXPORT ssize_t nxt_fd_write(nxt_fd_t fd, u_char *buf, size_t size); NXT_EXPORT ssize_t nxt_fd_read(nxt_fd_t fd, u_char *buf, size_t size); NXT_EXPORT void nxt_fd_close(nxt_fd_t fd); +NXT_EXPORT FILE *nxt_file_fopen(nxt_task_t *task, const char *pathname, + const char *mode); +NXT_EXPORT void nxt_file_fclose(nxt_task_t *task, FILE *fp); + NXT_EXPORT nxt_int_t nxt_file_redirect(nxt_file_t *file, nxt_fd_t fd); NXT_EXPORT nxt_int_t nxt_file_stderr(nxt_file_t *file); NXT_EXPORT nxt_int_t nxt_stderr_start(void); |