AquilaOS documentation
How it works, and its code
Loading...
Searching...
No Matches
memdev.h File Reference
#include <dev/dev.h>

Go to the source code of this file.

Variables

struct dev nulldev
struct dev zerodev
struct dev randomdev
struct dev kmsgdev

Variable Documentation

◆ kmsgdev

struct dev kmsgdev
extern

Definition at line 18 of file kmsg.c.

Referenced by memdev_mux().

◆ nulldev

struct dev nulldev
extern
Initial value:
= {
.read = nulldev_read,
.write = nulldev_write,
.fops = {
.open = posix_file_open,
.read = posix_file_read,
.write = posix_file_write,
.close = posix_file_close,
.can_read = __vfs_can_always,
.can_write = __vfs_can_always,
.eof = __vfs_eof_always,
},
}
int posix_file_open(struct file *file)
Finishes opening a file: with O_TRUNC, a regular file is truncated to 0 bytes.
Definition open.c:17
int posix_file_close(struct file *file)
Closes an open file by dropping its reference to its vnode.
Definition close.c:15
ssize_t posix_file_read(struct file *file, struct iobuf *io)
Reads from an open file at its offset, and moves the offset past what was read.
Definition read.c:29
ssize_t posix_file_write(struct file *file, struct iobuf *io)
Writes to an open file at its offset, and moves the offset past what was written.
Definition write.c:25

Definition at line 27 of file null.c.

Referenced by memdev_mux().

◆ randomdev

struct dev randomdev
extern

Definition at line 173 of file random.c.

Referenced by memdev_mux().

◆ zerodev

struct dev zerodev
extern
Initial value:
= {
.read = zerodev_read,
.write = zerodev_write,
.fops = {
.open = posix_file_open,
.read = posix_file_read,
.write = posix_file_write,
.close = posix_file_close,
.can_read = __vfs_can_always,
.can_write = __vfs_can_always,
.eof = __vfs_eof_never,
},
}

Definition at line 27 of file zero.c.

Referenced by memdev_mux().