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

Joe Fouche (jf@helix.caltech.edu)
Fri, 10 May 1996 01:14:03 -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? :->

OOPS! Hope no one tried to apply that cruft I left at the end
of the message... :) This one really works, comments welcome.

--jf

--- 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;
}