wired
libc-free QUIC/HTTP3 SDK in C for x86_64-linux
Loading...
Searching...
No Matches
fio.h
Go to the documentation of this file.
1#ifndef FIO_H
2#define FIO_H
3
6
11
16#define WIRED_FIO_ETOOBIG (-27)
17
30ssz wired_fio_read(const char* path, wired_mspan buf);
31
39
51ssz wired_fio_append(const char* path, wired_span data);
52
64ssz wired_fio_open(const char* path);
65
73ssz wired_fio_size(const char* path);
74
87
98i64 wired_fio_mkdir(const char* path);
99
110i64 wired_fio_write_new(const char* path, wired_span data);
111
120
121#endif
ssz wired_fio_read(const char *path, wired_mspan buf)
Read the whole file at path into buf.
i64 wired_fio_mkdir(const char *path)
Create the directory at path (mkdirat(AT_FDCWD, path, 0755)).
ssz wired_fio_size(const char *path)
The file's total size in bytes (via newfstatat's st_size), without disturbing any open descriptor's r...
wired_span wired_fio_read_span(const char *path, wired_mspan buf)
wired_fio_read returning the bytes read as a view into buf.
i64 wired_fio_write_new(const char *path, wired_span data)
Replace the file at path with data.
ssz wired_fio_append(const char *path, wired_span data)
Append data to the file at path, creating it (mode 0600) if it does not exist.
ssz wired_fio_pread(i64 fd, wired_mspan buf, u64 off)
Read up to buf.n bytes from fd starting at byte offset off (pread64: does not move any shared file po...
ssz wired_fio_open(const char *path)
Open path for reading (openat(AT_FDCWD, path, O_RDONLY)), leaving the descriptor open for repeated wi...
void wired_fio_close(i64 fd)
Close a descriptor from wired_fio_open.
Value-type views that fold the SDK's recurring argument shapes into single parameters,...
Mutable view of a byte range.
Definition span.h:42
Read-only view of a byte range.
Definition span.h:30
Linux direct syscalls.
long i64
signed 64-bit integer
Definition types.h:14
i64 ssz
signed size (ssize_t equivalent)
Definition types.h:19
unsigned long u64
unsigned 64-bit integer
Definition types.h:13