mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 10:48:41 +00:00
Kernel: Implement the setkeymap() syscall.
This commit is contained in:
committed by
Andreas Kling
parent
28ada30783
commit
794ca16cca
@@ -7,6 +7,7 @@
|
||||
#include <Kernel/Arch/i386/PIT.h>
|
||||
#include <Kernel/Console.h>
|
||||
#include <Kernel/Devices/NullDevice.h>
|
||||
#include <Kernel/Devices/KeyboardDevice.h>
|
||||
#include <Kernel/Devices/RandomDevice.h>
|
||||
#include <Kernel/FileSystem/Custody.h>
|
||||
#include <Kernel/FileSystem/DevPtsFS.h>
|
||||
@@ -3276,6 +3277,22 @@ int Process::sys$getrandom(void* buffer, size_t buffer_size, unsigned int flags
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Process::sys$setkeymap(char* map, char* shift_map, char* alt_map)
|
||||
{
|
||||
if (!is_superuser())
|
||||
return -EPERM;
|
||||
|
||||
if (!validate_read(map, 0x80))
|
||||
return -EFAULT;
|
||||
if (!validate_read(shift_map, 0x80))
|
||||
return -EFAULT;
|
||||
if (!validate_read(alt_map, 0x80))
|
||||
return -EFAULT;
|
||||
|
||||
KeyboardDevice::the().set_maps(map, shift_map, alt_map);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Process::sys$clock_gettime(clockid_t clock_id, timespec* ts)
|
||||
{
|
||||
if (!validate_write_typed(ts))
|
||||
|
||||
Reference in New Issue
Block a user