PatchworkOS  966e257
A non-POSIX operating system.
Loading...
Searching...
No Matches
log_file.h
Go to the documentation of this file.
1#pragma once
2
3#include <stdint.h>
4
5/**
6 * @brief Userspace kernel log file.
7 * @defgroup kernel_log_file Log file
8 * @ingroup kernel_log
9 *
10 * The kernel logs are exposed to userspace via the readable, writable, and pollable `/dev/klog` file.
11 *
12 * @{
13 */
14
15/**
16 * @brief Maximum buffer size for the log file.
17 */
18#define LOG_FILE_MAX_BUFFER 0x10000
19
20/**
21 * @brief Expose the kernel log file to userspace in sysfs.
22 */
23void log_file_expose(void);
24
25/**
26 * @brief Flush the content of the log file to the screen.
27 */
29
30/**
31 * @brief Write a string to the kernel log file.
32 *
33 * @param string The string to write.
34 * @param length The length of the string.
35 */
36void log_file_write(const char* string, uint64_t length);
37
38/** @} */
void log_file_flush_to_screen(void)
Flush the content of the log file to the screen.
Definition log_file.c:89
void log_file_expose(void)
Expose the kernel log file to userspace in sysfs.
Definition log_file.c:62
void log_file_write(const char *string, uint64_t length)
Write a string to the kernel log file.
Definition log_file.c:129
__UINT64_TYPE__ uint64_t
Definition stdint.h:17