From dc0f47e390e3b18acc6fd058e55f95e25e9b572b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Thu, 14 Oct 2004 17:49:58 +0000 Subject: [PATCH] Implemented load_image() using the new _kern_load_image() syscall. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9358 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/libroot/os/image.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/kernel/libroot/os/image.c b/src/kernel/libroot/os/image.c index ae2acd86df..d69604b239 100644 --- a/src/kernel/libroot/os/image.c +++ b/src/kernel/libroot/os/image.c @@ -16,10 +16,18 @@ static struct rld_export const *sRuntimeLinker; thread_id -load_image(int32 argc, const char **argv, const char **environ) +load_image(int32 argCount, const char **args, const char **environ) { - // ToDo: implement this! - return B_ERROR; + int32 envCount = 0; + + if (argCount < 1 || environ == NULL) + return B_BAD_VALUE; + + // count environment variables + while (environ[envCount] != NULL) + envCount++; + + return _kern_load_image(argCount, args, envCount, environ, B_NORMAL_PRIORITY); }