/proc/cflags [PATCH] [take two] Was: animal names

Joe Fouche (jf@helix.caltech.edu)
Wed, 8 May 1996 18:06:05 -0700 (PDT)


Joel Maslak:
>
> This patch works on a recent kernel.
>
> It adds a /proc/animal so you can see what 'animal' the kernel currently
> is. (This will not break until 2.10.0. It will work fine with 1.3.100

What's next, /proc/cflags? :->

.-.
. |-
-- -- | |
\_/

--- linux/fs/proc/array.c Wed May 1 13:22:29 1996
+++ linux/fs/proc/array.c.orig Wed May 1 13:13:45 1996
@@ -43,7 +43,6 @@
#include <linux/mm.h>
#include <linux/pagemap.h>
#include <linux/swap.h>
-#include <linux/compile.h>

#include <asm/segment.h>
#include <asm/pgtable.h>
@@ -318,11 +317,6 @@
return sprintf(buffer, "%s\n", saved_command_line);
}

-static int get_cflags(char * buffer)
-{
- return sprintf(buffer, "%s\n", LINUX_CFLAGS);
-}
-
static struct task_struct ** get_task(pid_t pid)
{
struct task_struct ** p;
@@ -1047,8 +1041,6 @@
case PROC_RTC:
return get_rtc_status(page);
#endif
- case PROC_CFLAGS:
- return get_cflags(page);
}
return -EBADF;
}
233d232
< @echo \#define LINUX_CFLAGS \"$(CFLAGS)\" >> .ver
45,46c45
< PROC_RTC,
< PROC_CFLAGS

---
> 	PROC_RTC
362,366d361
< 	proc_register(&proc_root, &(struct proc_dir_entry) {
< 		PROC_CFLAGS, 6, "cflags",
< 		S_IFREG | S_IRUGO, 1, 0, 0,
< 	});
< 
46d45
< #include <linux/compile.h>
321,325d319
< static int get_cflags(char * buffer)
< {
<         return sprintf(buffer, "%s\n", LINUX_CFLAGS);
< }
< 
1050,1051d1043
<                 case PROC_CFLAGS:
<                        return get_cflags(page);
--- linux/Makefile	Wed May  1 13:30:22 1996
+++ linux/Makefile.orig	Wed May  1 13:01:45 1996
@@ -230,7 +230,6 @@
 	   echo \#define LINUX_COMPILE_DOMAIN ; \
 	 fi >> .ver
 	@echo \#define LINUX_COMPILER \"`$(HOSTCC) -v 2>&1 | tail -1`\" >> .ver
-	@echo \#define LINUX_CFLAGS \"$(CFLAGS)\" >> .ver
 	@mv -f .ver $@
 
 include/linux/version.h: ./Makefile
--- linux/include/linux/proc_fs.h	Wed May  1 13:12:43 1996
+++ linux/include/linux/proc_fs.h.orig	Wed May  1 13:11:54 1996
@@ -42,8 +42,7 @@
 	PROC_SYS,
 	PROC_MTAB,
 	PROC_MD,
-	PROC_RTC,
-        PROC_CFLAGS
+	PROC_RTC
 };
 
 enum pid_directory_inos {
--- linux/fs/proc/root.c	Wed May  1 16:20:31 1996
+++ linux/fs/proc/root.c.orig	Wed May  1 13:21:18 1996
@@ -359,11 +359,6 @@
 	});
 #endif
 
-	proc_register(&proc_root, &(struct proc_dir_entry) {
-		PROC_CFLAGS, 6, "cflags",
-		S_IFREG | S_IRUGO, 1, 0, 0,
-	});
-
 	proc_register( &proc_root, &(struct proc_dir_entry)
 	   { PROC_MTAB, 6, "mounts", S_IFREG | S_IRUGO, 1, 0, 0, } );
 		   
--- linux/fs/proc/array.c	Wed May  1 13:22:29 1996
+++ linux/fs/proc/array.c.orig	Wed May  1 13:13:45 1996
@@ -43,7 +43,6 @@
 #include <linux/mm.h>
 #include <linux/pagemap.h>
 #include <linux/swap.h>
-#include <linux/compile.h>
 
 #include <asm/segment.h>
 #include <asm/pgtable.h>
@@ -318,11 +317,6 @@
 	return sprintf(buffer, "%s\n", saved_command_line);
 }
 
-static int get_cflags(char * buffer)
-{
-        return sprintf(buffer, "%s\n", LINUX_CFLAGS);
-}
-
 static struct task_struct ** get_task(pid_t pid)
 {
 	struct task_struct ** p;
@@ -1047,8 +1041,6 @@
 		case PROC_RTC:
 			return get_rtc_status(page);
 #endif
-                case PROC_CFLAGS:
-                       return get_cflags(page);
 	}
 	return -EBADF;
 }
--- linux/Makefile.orig	Wed May  1 13:01:45 1996
+++ linux/Makefile	Wed May  1 13:30:22 1996
@@ -230,6 +230,7 @@
 	   echo \#define LINUX_COMPILE_DOMAIN ; \
 	 fi >> .ver
 	@echo \#define LINUX_COMPILER \"`$(HOSTCC) -v 2>&1 | tail -1`\" >> .ver
+	@echo \#define LINUX_CFLAGS \"$(CFLAGS)\" >> .ver
 	@mv -f .ver $@
 
 include/linux/version.h: ./Makefile
--- linux/include/linux/proc_fs.h.orig	Wed May  1 13:11:54 1996
+++ linux/include/linux/proc_fs.h	Wed May  1 13:12:43 1996
@@ -42,7 +42,8 @@
 	PROC_SYS,
 	PROC_MTAB,
 	PROC_MD,
-	PROC_RTC
+	PROC_RTC,
+        PROC_CFLAGS
 };
 
 enum pid_directory_inos {
--- linux/fs/proc/root.c.orig	Wed May  1 13:21:18 1996
+++ linux/fs/proc/root.c	Wed May  1 16:20:31 1996
@@ -359,6 +359,11 @@
 	});
 #endif
 
+	proc_register(&proc_root, &(struct proc_dir_entry) {
+		PROC_CFLAGS, 6, "cflags",
+		S_IFREG | S_IRUGO, 1, 0, 0,
+	});
+
 	proc_register( &proc_root, &(struct proc_dir_entry)
 	   { PROC_MTAB, 6, "mounts", S_IFREG | S_IRUGO, 1, 0, 0, } );
 		   
--- linux/fs/proc/array.c.orig	Wed May  1 13:13:45 1996
+++ linux/fs/proc/array.c	Wed May  1 13:22:29 1996
@@ -43,6 +43,7 @@
 #include <linux/mm.h>
 #include <linux/pagemap.h>
 #include <linux/swap.h>
+#include <linux/compile.h>
 
 #include <asm/segment.h>
 #include <asm/pgtable.h>
@@ -317,6 +318,11 @@
 	return sprintf(buffer, "%s\n", saved_command_line);
 }
 
+static int get_cflags(char * buffer)
+{
+        return sprintf(buffer, "%s\n", LINUX_CFLAGS);
+}
+
 static struct task_struct ** get_task(pid_t pid)
 {
 	struct task_struct ** p;
@@ -1041,6 +1047,8 @@
 		case PROC_RTC:
 			return get_rtc_status(page);
 #endif
+                case PROC_CFLAGS:
+                       return get_cflags(page);
 	}
 	return -EBADF;
 }