[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20060827192030.633cf467.rdunlap@xenotime.net>
Date: Sun, 27 Aug 2006 19:20:30 -0700
From: "Randy.Dunlap" <rdunlap@...otime.net>
To: Arnd Bergmann <arnd@...db.de>
Cc: linux-kernel@...r.kernel.org, linux-arch@...r.kernel.org,
Jeff Dike <jdike@...toit.com>,
Bjoern Steinbrink <B.Steinbrink@....de>,
Arjan van de Ven <arjan@...radead.org>,
Chase Venters <chase.venters@...entec.com>,
Andrew Morton <akpm@...l.org>,
Russell King <rmk+lkml@....linux.org.uk>, rusty@...tcorp.com.au
Subject: Re: [PATCH 2/7] rename the provided execve functions to
kernel_execve
On Sun, 27 Aug 2006 23:47:36 +0200 Arnd Bergmann wrote:
> --- linux-cg.orig/drivers/sbus/char/envctrl.c 2006-08-27 23:36:36.000000000 +0200
> +++ linux-cg/drivers/sbus/char/envctrl.c 2006-08-27 23:36:42.000000000 +0200
> @@ -19,9 +19,6 @@
> * Daniele Bellucci <bellucda@...cali.it>
> */
>
> -#define __KERNEL_SYSCALLS__
> -static int errno;
> -
> #include <linux/module.h>
> #include <linux/sched.h>
> #include <linux/kthread.h>
> @@ -982,7 +979,7 @@
>
> inprog = 1;
> printk(KERN_CRIT "kenvctrld: WARNING: Shutting down the system now.\n");
> - if (0 > execve("/sbin/shutdown", argv, envp)) {
> + if (0 > kernel_execve("/sbin/shutdown", argv, envp)) {
> printk(KERN_CRIT "kenvctrld: WARNING: system shutdown failed!\n");
> inprog = 0; /* unlikely to succeed, but we could try again */
> }
Linux just educated the git mailing list (yesterday) about ordering
of comparisons, so while here, please change the order inside the if()
to be like the others:
if (kernel_execv(...) < 0)
> Index: linux-cg/include/linux/syscalls.h
> ===================================================================
> --- linux-cg.orig/include/linux/syscalls.h 2006-08-27 23:36:36.000000000 +0200
> +++ linux-cg/include/linux/syscalls.h 2006-08-27 23:36:42.000000000 +0200
> @@ -597,4 +597,6 @@
> asmlinkage long sys_set_robust_list(struct robust_list_head __user *head,
> size_t len);
>
> +int kernel_execve(const char *filename, char *const argv[], char *const envp[]);
> +
> #endif
Question:
All other syscalls (in syscalls.h) return long or unsigned long
or ssize_t etc. I.e., none of them return int. Does this one
return int because it's strictly an inside-the-kernel "syscall",
not exposed to userspace?
---
~Randy
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists