Back to home page

LXR

 
 

    


0001 /*
0002  * Handling of different ABIs (personalities).
0003  *
0004  * We group personalities into execution domains which have their
0005  * own handlers for kernel entry points, signal mapping, etc...
0006  *
0007  * 2001-05-06   Complete rewrite,  Christoph Hellwig (hch@infradead.org)
0008  */
0009 
0010 #include <linux/init.h>
0011 #include <linux/kernel.h>
0012 #include <linux/kmod.h>
0013 #include <linux/module.h>
0014 #include <linux/personality.h>
0015 #include <linux/proc_fs.h>
0016 #include <linux/sched.h>
0017 #include <linux/seq_file.h>
0018 #include <linux/syscalls.h>
0019 #include <linux/sysctl.h>
0020 #include <linux/types.h>
0021 #include <linux/fs_struct.h>
0022 
0023 #ifdef CONFIG_PROC_FS
0024 static int execdomains_proc_show(struct seq_file *m, void *v)
0025 {
0026     seq_puts(m, "0-0\tLinux           \t[kernel]\n");
0027     return 0;
0028 }
0029 
0030 static int execdomains_proc_open(struct inode *inode, struct file *file)
0031 {
0032     return single_open(file, execdomains_proc_show, NULL);
0033 }
0034 
0035 static const struct file_operations execdomains_proc_fops = {
0036     .open       = execdomains_proc_open,
0037     .read       = seq_read,
0038     .llseek     = seq_lseek,
0039     .release    = single_release,
0040 };
0041 
0042 static int __init proc_execdomains_init(void)
0043 {
0044     proc_create("execdomains", 0, NULL, &execdomains_proc_fops);
0045     return 0;
0046 }
0047 module_init(proc_execdomains_init);
0048 #endif
0049 
0050 SYSCALL_DEFINE1(personality, unsigned int, personality)
0051 {
0052     unsigned int old = current->personality;
0053 
0054     if (personality != 0xffffffff)
0055         set_personality(personality);
0056 
0057     return old;
0058 }