PatchworkOS
Loading...
Searching...
No Matches
key.h
Go to the documentation of this file.
1#pragma once
2
3#include <kernel/fs/file.h>
4#include <kernel/utils/map.h>
5
6#include <sys/io.h>
7#include <sys/list.h>
8
32
36void key_init(void);
37
46uint64_t key_share(key_t* key, file_t* file, clock_t timeout);
47
55
void key_init(void)
Initializes the key subsystem.
Definition key.c:60
file_t * key_claim(key_t *key)
Claims a shared file using the provided key.
Definition key.c:151
uint64_t key_share(key_t *key, file_t *file, clock_t timeout)
Generates a key that can be used to retrieve the file within the specified timeout.
Definition key.c:70
__UINT64_TYPE__ clock_t
A nanosecond time.
Definition clock_t.h:13
static dentry_t * file
Definition log_file.c:17
__UINT64_TYPE__ uint64_t
Definition stdint.h:17
File structure.
Definition file.h:37
Key entry.
Definition key.h:25
clock_t expiry
Definition key.h:30
key_t key
Definition key.h:28
list_entry_t entry
Used to store the key entry in a time sorted list.
Definition key.h:26
file_t * file
Definition key.h:29
map_entry_t mapEntry
Used to store the key entry in a map for fast lookup.
Definition key.h:27
Key type.
Definition io.h:503
A entry in a doubly linked list.
Definition list.h:38
Map entry structure.
Definition map.h:57