patch to add /proc/sys/kernel/java-{interpreter,appletviewer}

Mike Shaver (shaver@neon.ingenia.ca)
Fri, 10 May 1996 16:37:05 -0400 (EDT)


This patch against 1.3.100 makes the paths to the Java interpreter and
appletviewer configurable through sysctl.

Documentation/java.txt has been updated to reflect the change.

Comments welcome, etc.

Mike
Index: Documentation/java.txt
===================================================================
RCS file: /devel/linux/Documentation/java.txt,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 java.txt
1,2c1,2
< JAVA Binary Kernel Support for Linux v1.01
< ------------------------------------------

---
>                Java(tm) Binary Kernel Support for Linux v1.01
>                ----------------------------------------------
17,19c17,25
< 	   directory of /usr/local/java, then you will need to edit the
< 	   kernel's fs/binfmt_java.c file and make the needed change to the
< 	   _PATH_JAVA definition at the top of that file.
---
> 	   directory of /usr/local/java, then you will need to tell the
> 	   kernel where you put the Java interpreter.  
>            There are two ways to do this.
>            One, edit fs/binfmt_java.c file and make the needed change to 
> 	   the _PATH_JAVA definition at the top of that file.  
>            Two, as root, issue the command:
> 	 echo "/path/to/java/interpreter" > /proc/sys/kernel/java-interpreter
> 	   (Currently, this does not work if you're using a module for
> 	    Java support.)
33d38
< 
54c59
< 	./HellowWorld.class
---
> 	./HelloWorld.class
78,80c83,91
< 	   directory of /usr/local/java, then you will need to edit the
< 	   kernel's fs/binfmt_java.c file and make the needed change to the
< 	   _PATH_APPLET definition at the top of that file.
---
> 	   directory of /usr/local/java, then you will need to tell the
> 	   kernel where you put the Java appletviewer.  
>            There are two ways to do this.
>            One, edit fs/binfmt_java.c file and make the needed change to 
> 	   the _PATH_APPLET definition at the top of that file.  
>            Two, as root, issue the command:
> 	echo "/path/to/java/appletviewer" > /proc/sys/kernel/java-appletviewer
> 	   (Currently, this does not work if you're using a module for
> 	    Java support.)
89d99
< 
91a102,103
> (/proc/sys/kernel/java-* support by Mike Shaver (shaver@ingenia.com))
> 
Index: fs/binfmt_java.c
===================================================================
RCS file: /devel/linux/fs/binfmt_java.c,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 binfmt_java.c
18a19,21
> char binfmt_java_interpreter[65] = _PATH_JAVA;
> char binfmt_java_appletviewer[65] = _PATH_APPLET;
> 
50c53
< 	strcpy (bprm->buf, _PATH_JAVA);
---
> 	strcpy (bprm->buf, binfmt_java_interpreter);
105c108
< 	strcpy (bprm->buf, _PATH_APPLET);
---
> 	strcpy (bprm->buf, binfmt_java_appletviewer);
110c113
< 	strcpy (bprm->buf, _PATH_BSHELL);
---
> 	strcpy (bprm->buf, _PATH_BASH);
Index: include/linux/sysctl.h
===================================================================
RCS file: /devel/linux/include/linux/sysctl.h,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 sysctl.h
61a62,63
> #define KERN_JAVA_INTERPRETER 19 /* path to Java(tm) interpreter */
> #define KERN_JAVA_APPLETVIEWER 20 /* path to Java(tm) appletviewer */
Index: kernel/sysctl.c
===================================================================
RCS file: /devel/linux/kernel/sysctl.c,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 sysctl.c
7a8
>  * Added kernel/java-{interpreter,appletviewer}, 96/5/10, Mike Shaver.
99a101,102
> extern char binfmt_java_interpreter[], binfmt_java_appletviewer[];
> 
140a144,149
> #endif
> #ifdef CONFIG_BINFMT_JAVA
> 	{KERN_JAVA_INTERPRETER, "java-interpreter", binfmt_java_interpreter,
> 	 64, 0644, NULL, &proc_dostring, &sysctl_string },
> 	{KERN_JAVA_APPLETVIEWER, "java-appletviewer", binfmt_java_appletviewer,
> 	 64, 0644, NULL, &proc_dostring, &sysctl_string },