From 6760856791c6e527da678021ee6a67896549d4da Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Mon, 2 Oct 2006 02:18:26 -0700 Subject: [PATCH] introduce kernel_execve The use of execve() in the kernel is dubious, since it relies on the __KERNEL_SYSCALLS__ mechanism that stores the result in a global errno variable. As a first step of getting rid of this, change all users to a global kernel_execve function that returns a proper error code. This function is a terrible hack, and a later patch removes it again after the kernel syscalls are gone. Signed-off-by: Arnd Bergmann Cc: Andi Kleen Cc: Paul Mackerras Cc: Benjamin Herrenschmidt Cc: Richard Henderson Cc: Ivan Kokshaysky Cc: Russell King Cc: Ian Molton Cc: Mikael Starvik Cc: David Howells Cc: Yoshinori Sato Cc: Hirokazu Takata Cc: Ralf Baechle Cc: Kyle McMartin Cc: Heiko Carstens Cc: Martin Schwidefsky Cc: Paul Mundt Cc: Kazumoto Kojima Cc: Richard Curnow Cc: William Lee Irwin III Cc: "David S. Miller" Cc: Jeff Dike Cc: Paolo 'Blaisorblade' Giarrusso Cc: Miles Bader Cc: Chris Zankel Cc: "Luck, Tony" Cc: Geert Uytterhoeven Cc: Roman Zippel Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- arch/sparc64/kernel/power.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'arch/sparc64') diff --git a/arch/sparc64/kernel/power.c b/arch/sparc64/kernel/power.c index e55466c77b6..0b9c70627ce 100644 --- a/arch/sparc64/kernel/power.c +++ b/arch/sparc64/kernel/power.c @@ -4,8 +4,6 @@ * Copyright (C) 1999 David S. Miller (davem@redhat.com) */ -#define __KERNEL_SYSCALLS__ - #include #include #include @@ -14,6 +12,7 @@ #include #include #include +#include #include #include @@ -98,7 +97,7 @@ again: /* Ok, down we go... */ button_pressed = 0; - if (execve("/sbin/shutdown", argv, envp) < 0) { + if (kernel_execve("/sbin/shutdown", argv, envp) < 0) { printk("powerd: shutdown execution failed\n"); add_wait_queue(&powerd_wait, &wait); goto again; -- cgit v1.2.3