summaryrefslogtreecommitdiff
path: root/kernel/random.c
diff options
context:
space:
mode:
authorAnton Kling <anton@kling.gg>2024-04-26 19:06:46 +0200
committerAnton Kling <anton@kling.gg>2024-04-26 19:06:46 +0200
commit7ab3153f92f38223157c4c1f4af1c30e33c94a76 (patch)
tree301f950cd6dc8fde244e9b5c1201ec01d964347b /kernel/random.c
parent2e2805c88789c148cce0118d3a4ff0212458bb86 (diff)
Kernel/VFS: Change polling from variables to functions
Instead of having to store state in variables functions are called to check the object directly.
Diffstat (limited to 'kernel/random.c')
-rw-r--r--kernel/random.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/kernel/random.c b/kernel/random.c
index 38924ce..2d77ccd 100644
--- a/kernel/random.c
+++ b/kernel/random.c
@@ -155,8 +155,8 @@ int random_read(BYTEPTR buffer, u64 offset, u64 len, vfs_fd_t *fd) {
}
void add_random_devices(void) {
- devfs_add_file("/random", random_read, random_write, NULL, 1, 1,
- FS_TYPE_CHAR_DEVICE);
- devfs_add_file("/urandom", random_read, random_write, NULL, 1, 1,
- FS_TYPE_CHAR_DEVICE);
+ devfs_add_file("/random", random_read, random_write, NULL, always_has_data,
+ always_can_write, FS_TYPE_CHAR_DEVICE);
+ devfs_add_file("/urandom", random_read, random_write, NULL, always_has_data,
+ always_can_write, FS_TYPE_CHAR_DEVICE);
}