mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
arch: sandbox: Add function to create temporary files
When working with sparse data buffers that may be larger than the address space, it is convenient to work with files instead. Add a function to create temporary files of a certain size. Signed-off-by: Sean Anderson <seanga2@gmail.com>
This commit is contained in:
13
include/os.h
13
include/os.h
@@ -108,6 +108,19 @@ int os_unlink(const char *pathname);
|
||||
*/
|
||||
int os_persistent_file(char *buf, int maxsize, const char *fname);
|
||||
|
||||
/**
|
||||
* os_mktemp() - Create a temporary file
|
||||
* @fname: The template to use for the file name. This must end with 6 Xs. It
|
||||
* will be modified to the opened filename on success.
|
||||
* @size: The size of the file
|
||||
*
|
||||
* Create a temporary file using @fname as a template, unlink it, and truncate
|
||||
* it to @size.
|
||||
*
|
||||
* Return: A file descriptor, or negative errno on error
|
||||
*/
|
||||
int os_mktemp(char *fname, off_t size);
|
||||
|
||||
/**
|
||||
* os_exit() - access to the OS exit() system call
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user