vfs: check userland buffers before reading them.
[haiku.git] / src / tools / fs_shell / kernel_export.cpp
blob478aee8603117c42d410594c2604d7efe0dd557a
1 /*
2 * Copyright 2007, Ingo Weinhold, bonefish@cs.tu-berlin.de.
3 * Distributed under the terms of the MIT License.
4 */
6 #include "fssh_kernel_export.h"
8 #include <stdarg.h>
9 #include <stdio.h>
10 #include <stdlib.h>
11 #include <string.h>
13 #include "fssh_errors.h"
16 fssh_thread_id
17 fssh_spawn_kernel_thread(fssh_thread_func function, const char *threadName,
18 int32_t priority, void *arg)
20 return FSSH_B_ERROR;
24 fssh_status_t
25 fssh_user_memcpy(void *dest, const void *source, fssh_size_t length)
27 memcpy(dest, source, length);
28 return FSSH_B_OK;
32 void
33 fssh_dprintf(const char *format, ...)
35 va_list args;
36 va_start(args, format);
38 vprintf(format, args);
40 va_end(args);
44 void
45 fssh_kprintf(const char *format, ...)
47 va_list args;
48 va_start(args, format);
50 vprintf(format, args);
52 va_end(args);
56 void
57 fssh_dump_block(const char *buffer, int size, const char *prefix)
62 void
63 fssh_panic(const char *format, ...)
65 va_list args;
66 va_start(args, format);
68 vfprintf(stderr, format, args);
70 va_end(args);
72 // exit(1);
73 int* badAddress = 0;
74 *badAddress = 42;
78 void
79 fssh_kernel_debugger(const char *message)
81 fssh_panic("%s", message);
85 uint32_t
86 fssh_parse_expression(const char *string)
88 return 0;
92 int
93 fssh_add_debugger_command(const char *name, fssh_debugger_command_hook hook,
94 const char *help)
96 return 0;
101 fssh_remove_debugger_command(char *name, fssh_debugger_command_hook hook)
103 return 0;