Implemented get_safemode_option() (not yet tested).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10657 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004, Axel Dörfler, [email protected]. All rights reserved.
|
* Copyright 2004-2005, Axel Dörfler, [email protected]. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -10,14 +10,26 @@
|
|||||||
#include <kernel.h>
|
#include <kernel.h>
|
||||||
#include <syscalls.h>
|
#include <syscalls.h>
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
|
||||||
extern "C" status_t
|
extern "C" status_t
|
||||||
get_safemode_option(const char *parameter, char *buffer, size_t *_bufferSize)
|
get_safemode_option(const char *parameter, char *buffer, size_t *_bufferSize)
|
||||||
{
|
{
|
||||||
// ToDo: implement me for real!
|
void *handle = load_driver_settings(B_SAFEMODE_DRIVER_SETTINGS);
|
||||||
// We could also think about making this available in the kernel (by making it non-static)
|
if (handle == NULL)
|
||||||
|
return B_ENTRY_NOT_FOUND;
|
||||||
|
|
||||||
return B_ENTRY_NOT_FOUND;
|
status_t status = B_ENTRY_NOT_FOUND;
|
||||||
|
|
||||||
|
const char *value = get_driver_parameter(handle, parameter, NULL, NULL);
|
||||||
|
if (value != NULL) {
|
||||||
|
*_bufferSize = strlcpy(buffer, value, *_bufferSize);
|
||||||
|
status = B_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
unload_driver_settings(handle);
|
||||||
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user