Skip to main content

Module sys

Module sys 

Source
Expand description

Thin userspace helpers over the Strat9 VFS syscalls used by telnetd.

Re-exportsยง

use alloc::string::String; ๐Ÿ”’
use alloc::vec::Vec; ๐Ÿ”’
use strat9_syscall::call; ๐Ÿ”’
use strat9_syscall::data::FileStat; ๐Ÿ”’
use strat9_syscall::data::TimeSpec; ๐Ÿ”’
use strat9_syscall::dirent::DirentIter; ๐Ÿ”’
use strat9_syscall::error::Error; ๐Ÿ”’
use strat9_syscall::flag::OpenFlags; ๐Ÿ”’
use strat9_syscall::number; ๐Ÿ”’

Structsยง

DirEntry
One decoded directory entry.

Constantsยง

DT_DIR
DT_LNK
EAGAIN
ECONNRESET
S_IFDIR
S_IFLNK
S_IFMT

Functionsยง

basename
Last component of a path (/ for the root).
chmod
civil_from_days
Convert days since 1970-01-01 to (year, month 1-12, day 1-31).
err_text
Short English description of an error.
format_mode
drwxr-xr-x style mode string.
format_time
YYYY-MM-DD HH:MM for a unix timestamp.
format_time_full
YYYY-MM-DD HH:MM:SS.nnnnnnnnn (UTC) for a timestamp.
is_dir
join
link
log
mkdir
normalize
Collapse ., .. and duplicate / in an absolute path.
now
Wall-clock time (CLOCK_REALTIME).
open
read_dir
List a directory (entries ./.. removed, sorted by name).
read_file
Read up to cap bytes of a file.
read_text_file
Read a small text file, returning the byte count (0 on any error).
rename
resolve
Resolve path against cwd into a normalized absolute path.
rmdir
sleep_ms
stat
unlink
utimens
Set atime/mtime. None = both โ€œnowโ€ (like touch).
write_all
Write the whole buffer, retrying on EAGAIN (socket send window full).

Type Aliasesยง

Res