[PATCH 7/7] remove the global errno from the kernel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The last in-kernel user of errno is gone, so we should
remove the definition and everything referring to it.
This also removes the now-unused lib/execve.c file
that was introduced earlier.

Also remove a few bogus definitions of __KERNEL_SYSCALLS__
that were already unused.

Signed-off-by: Arnd Bergmann <[email protected]>
Index: linux-cg/lib/Makefile
===================================================================
--- linux-cg.orig/lib/Makefile	2006-08-27 23:44:35.000000000 +0200
+++ linux-cg/lib/Makefile	2006-08-27 23:44:38.000000000 +0200
@@ -2,7 +2,7 @@
 # Makefile for some libs needed in the kernel.
 #
 
-lib-y := errno.o ctype.o string.o vsprintf.o cmdline.o \
+lib-y := ctype.o string.o vsprintf.o cmdline.o \
 	 bust_spinlocks.o rbtree.o radix-tree.o dump_stack.o \
 	 idr.o div64.o int_sqrt.o bitmap.o extable.o prio_tree.o \
 	 sha1.o
Index: linux-cg/lib/execve.c
===================================================================
--- linux-cg.orig/lib/execve.c	2006-08-27 23:44:35.000000000 +0200
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,23 +0,0 @@
-#include <asm/bug.h>
-#include <asm/uaccess.h>
-
-#define __KERNEL_SYSCALLS__
-static int errno __attribute__((unused));
-#include <asm/unistd.h>
-
-#ifdef _syscall3
-int kernel_execve (const char *filename, char *const argv[], char *const envp[])
-								__attribute__((__weak__));
-int kernel_execve (const char *filename, char *const argv[], char *const envp[])
-{
-	mm_segment_t fs = get_fs();
-	int ret;
-
-	WARN_ON(segment_eq(fs, USER_DS));
-	ret = execve(filename, (char **)argv, (char **)envp);
-	if (ret)
-		ret = -errno;
-
-	return ret;
-}
-#endif
Index: linux-cg/include/linux/unistd.h
===================================================================
--- linux-cg.orig/include/linux/unistd.h	2006-08-27 23:41:34.000000000 +0200
+++ linux-cg/include/linux/unistd.h	2006-08-27 23:44:38.000000000 +0200
@@ -1,12 +1,8 @@
 #ifndef _LINUX_UNISTD_H_
 #define _LINUX_UNISTD_H_
 
-#ifdef __KERNEL__
-extern int errno;
-#endif
-
 /*
- * Include machine specific syscallX macros
+ * Include machine specific syscall numbers
  */
 #include <asm/unistd.h>
 
Index: linux-cg/lib/errno.c
===================================================================
--- linux-cg.orig/lib/errno.c	2006-08-27 23:41:34.000000000 +0200
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,7 +0,0 @@
-/*
- *  linux/lib/errno.c
- *
- *  Copyright (C) 1991, 1992  Linus Torvalds
- */
-
-int errno;
Index: linux-cg/arch/ia64/kernel/process.c
===================================================================
--- linux-cg.orig/arch/ia64/kernel/process.c	2006-08-27 23:44:53.000000000 +0200
+++ linux-cg/arch/ia64/kernel/process.c	2006-08-27 23:44:54.000000000 +0200
@@ -8,8 +8,6 @@
  * 2005-10-07 Keith Owens <[email protected]>
  *	      Add notify_die() hooks.
  */
-#define __KERNEL_SYSCALLS__	/* see <asm/unistd.h> */
-
 #include <linux/cpu.h>
 #include <linux/pm.h>
 #include <linux/elf.h>
Index: linux-cg/drivers/media/dvb/dvb-core/dvb_ringbuffer.c
===================================================================
--- linux-cg.orig/drivers/media/dvb/dvb-core/dvb_ringbuffer.c	2006-08-27 23:44:53.000000000 +0200
+++ linux-cg/drivers/media/dvb/dvb-core/dvb_ringbuffer.c	2006-08-27 23:44:54.000000000 +0200
@@ -26,7 +26,6 @@
 
 
 
-#define __KERNEL_SYSCALLS__
 #include <linux/errno.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
Index: linux-cg/drivers/net/wireless/ipw2100.c
===================================================================
--- linux-cg.orig/drivers/net/wireless/ipw2100.c	2006-08-27 23:44:53.000000000 +0200
+++ linux-cg/drivers/net/wireless/ipw2100.c	2006-08-27 23:44:54.000000000 +0200
@@ -150,7 +150,6 @@
 #include <linux/skbuff.h>
 #include <asm/uaccess.h>
 #include <asm/io.h>
-#define __KERNEL_SYSCALLS__
 #include <linux/fs.h>
 #include <linux/mm.h>
 #include <linux/slab.h>

--

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux