1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-01 00:32:04 +02:00

sandbox: Add a way to write data to the host filesystem

For debugging it is sometimes useful to write out data for inspection
using an external tool. Add a function which can write this data to a
given file.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2018-10-01 11:55:08 -06:00
parent 50b288aca3
commit 056a5cea31
2 changed files with 33 additions and 0 deletions

View File

@@ -347,4 +347,17 @@ void os_abort(void);
*/
int os_mprotect_allow(void *start, size_t len);
/**
* os_write_file() - Write a file to the host filesystem
*
* This can be useful when debugging for writing data out of sandbox for
* inspection by external tools.
*
* @name: File path to write to
* @buf: Data to write
* @size: Size of data to write
* @return 0 if OK, -ve on error
*/
int os_write_file(const char *name, const void *buf, int size);
#endif