tmpfile-util: Add fopen_temporary_at()

This commit is contained in:
Daan De Meyer
2022-11-09 11:14:10 +01:00
parent 86e69a44b4
commit e624d4cf07
2 changed files with 14 additions and 10 deletions
+5 -1
View File
@@ -1,9 +1,13 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <fcntl.h>
#include <stdio.h>
int fopen_temporary(const char *path, FILE **_f, char **_temp_path);
int fopen_temporary_at(int dir_fd, const char *path, FILE **ret_file, char **ret_path);
static inline int fopen_temporary(const char *path, FILE **ret_file, char **ret_path) {
return fopen_temporary_at(AT_FDCWD, path, ret_file, ret_path);
}
int mkostemp_safe(char *pattern);
int fmkostemp_safe(char *pattern, const char *mode, FILE**_f);