|
K-FSW v1.2.1-59-gcaca356
KFSW: modular flight software on Zephyr, for small satellites
|
Functions | |
| int | kfsw_snapshot_write (const char *path, const char *temporary_path, const uint8_t *data, size_t size) |
| int kfsw_snapshot_write | ( | const char * | path, |
| const char * | temporary_path, | ||
| const uint8_t * | data, | ||
| size_t | size | ||
| ) |
#include <snapshot.h>
Replace a file's contents atomically.
Writes a temporary file beside the target, syncs and closes it, then renames it over the target, so a reset during the write leaves the old contents.
| path | Target file. |
| temporary_path | Scratch file beside it, on the same mount. |
| data | Bytes to write. |
| size | How many. |
| 0 | The target now holds data. |
| -ENODEV | Storage is not mounted. |
| <0 | An errno from the filesystem; the target is unchanged. |