summaryrefslogtreecommitdiffhomepage
path: root/vm.c
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2022-02-15 11:28:38 +0100
committerJo-Philipp Wich <jo@mein.io>2022-02-15 11:32:43 +0100
commit4ce69a833cdd588cda621588f95502585cdbc63f (patch)
treee47ccab3f0879e1b039ca1775b6936cbd263f901 /vm.c
parenta29bad9454edcc285f7f37410b6822affede44d1 (diff)
fs: implement access(), mkstemp(), file.flush() and proc.flush()
The `access()` function allows testing the path given in the first argument for accessibility according to the permissions specified in the second mode string argument. The mode string characters may be `r`, `w`, `x` or `f` which correspond to `R_OK` - path is readable, `W_OK` - path is writable, `X_OK` - path is executable or `F_OK` - path exists respectively. The `mkstemp()` function creates a secure temporary file, unlinks it and returns the open file handle. The temporary path is constructed based on the optional template argument. If the template argument contains a slash, the path is taken as-is, if it contains no slashes, `/tmp/` is prepended. If the template does not end with `XXXXXX`, a `.XXXXXX` suffix is appended to the path. If the template is omitted, `/tmp/XXXXXX` is used. The `file.flush()` and `proc.flush()` functions call `fflush()` on the underlying file handle respectively. They take no arguments. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'vm.c')
0 files changed, 0 insertions, 0 deletions