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:
Axel Dörfler 2005-01-10 18:06:25 +00:00
parent 91f8300536
commit f1a1d6e98a
1 changed files with 16 additions and 4 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
* Copyright 2004-2005, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
* Distributed under the terms of the MIT License.
*/
@ -10,14 +10,26 @@
#include <kernel.h>
#include <syscalls.h>
#include <string.h>
extern "C" status_t
get_safemode_option(const char *parameter, char *buffer, size_t *_bufferSize)
{
// ToDo: implement me for real!
// We could also think about making this available in the kernel (by making it non-static)
void *handle = load_driver_settings(B_SAFEMODE_DRIVER_SETTINGS);
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;
}