diff -urN linux/fs/proc/array.c linux-2.3.20-execdomains/fs/proc/array.c --- linux/fs/proc/array.c Thu Sep 16 21:33:56 1999 +++ linux-2.3.20-execdomains/fs/proc/array.c Sun Oct 10 15:07:16 1999 @@ -46,6 +46,9 @@ * * Gerhard Wichert : added BIGMEM support * Siemens AG <Gerhard.Wichert@pdb.siemens.de> + * + * Tigran Aivazian : added /proc/execdomains support + * <tigran@sco.com> */ #include <linux/types.h> @@ -1328,6 +1331,8 @@ extern int get_device_list(char *); extern int get_partition_list(char *); extern int get_filesystem_list(char *); +extern struct proc_dir_entry proc_root_execdomains; +extern int get_exec_domain_list(char *); extern int get_filesystem_info( char * ); extern int get_irq_list(char *); extern int get_dma_list(char *); @@ -1442,6 +1447,9 @@ case PROC_STRAM: return get_stram_list(page); #endif + case PROC_EXECDOMAINS: + proc_root_execdomains.size = get_exec_domain_list(page); + return proc_root_execdomains.size; } return -EBADF; } diff -urN linux/fs/proc/root.c linux-2.3.20-execdomains/fs/proc/root.c --- linux/fs/proc/root.c Thu Sep 16 21:34:16 1999 +++ linux-2.3.20-execdomains/fs/proc/root.c Sun Oct 10 15:08:10 1999 @@ -602,6 +602,11 @@ S_IFREG | S_IRUGO, 1, 0, 0, 0, &proc_array_inode_operations }; +struct proc_dir_entry proc_root_execdomains = { + PROC_EXECDOMAINS, 11,"execdomains", + S_IFREG | S_IRUGO, 1, 0, 0, + 0, &proc_array_inode_operations +}; static struct proc_dir_entry proc_root_ksyms = { PROC_KSYMS, 5, "ksyms", S_IFREG | S_IRUGO, 1, 0, 0, @@ -750,6 +755,7 @@ proc_register(&proc_root, &proc_root_partitions); proc_register(&proc_root, &proc_root_interrupts); proc_register(&proc_root, &proc_root_filesystems); + proc_register(&proc_root, &proc_root_execdomains); proc_register(&proc_root, &proc_root_fs); proc_register(&proc_root, &proc_root_dma); proc_register(&proc_root, &proc_root_ioports); diff -urN linux/include/linux/proc_fs.h linux-2.3.20-execdomains/include/linux/proc_fs.h --- linux/include/linux/proc_fs.h Sat Oct 9 21:50:38 1999 +++ linux-2.3.20-execdomains/include/linux/proc_fs.h Sun Oct 10 15:13:34 1999 @@ -57,6 +57,7 @@ PROC_FS, PROC_SYSVIPC, PROC_DRIVER, + PROC_EXECDOMAINS, }; enum pid_directory_inos { diff -urN linux/kernel/exec_domain.c linux-2.3.20-execdomains/kernel/exec_domain.c --- linux/kernel/exec_domain.c Thu Sep 16 21:34:08 1999 +++ linux-2.3.20-execdomains/kernel/exec_domain.c Sun Oct 10 15:09:29 1999 @@ -97,6 +97,19 @@ return -EINVAL; } +int get_exec_domain_list(char * buf) +{ + int len = 0; + struct exec_domain * e; + + for (e=exec_domains; e && len < PAGE_SIZE - 80; e=e->next) + len += sprintf(buf+len, "%d-%d\t%-16s\t[%s]\n", + e->pers_low, e->pers_high, e->name, + e->module ? e->module->name : "kernel"); + + return len; +} + asmlinkage long sys_personality(unsigned long personality) { struct exec_domain *it;