|
ginnOS
The reference: libc, the libraries and the kernel
|
librat: open a root folder, the lock, and the root image check. More...
#include "internal.h"#include <errno.h>#include <fcntl.h>#include <stdlib.h>#include <string.h>#include <sys/file.h>#include <sys/stat.h>#include <unistd.h>Functions | |
| rat_t * | rat_open (const char *root, bool write, rat_error_t *err) |
| open a root folder. | |
| void | rat_close (rat_t *rat) |
| close the handle and release the lock. | |
| const char * | rat_recovered (const rat_t *rat) |
| what rat_open did with an interrupted change. | |
| bool | rat_pending (const rat_t *rat) |
| true if a handle opened for queries saw an interrupted change, which the next rat_open for writing finishes. | |
| bool | rat_root_in_ram (const rat_t *rat) |
| true if the root folder is the root image in RAM (from /proc/mounts): a change is then lost at the next boot. | |
librat: open a root folder, the lock, and the root image check.
| rat_t * rat_open | ( | const char * | root, |
| bool | write, | ||
| rat_error_t * | err ) |
open a root folder.
| root | the root folder; "/" on a running system. |
| write | true to change packages: takes the lock (one writer at a time), and finishes or removes an interrupted change. false for queries: no lock. |
| void rat_close | ( | rat_t * | rat | ) |
close the handle and release the lock.
| const char * rat_recovered | ( | const rat_t * | rat | ) |
what rat_open did with an interrupted change.
true if a handle opened for queries saw an interrupted change, which the next rat_open for writing finishes.
the queries can then show a state between the old one and the new one.