Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static int msr_open(struct inode *inode, struct file *file)
- {
- unsigned int cpu = iminor(file_inode(file));
- struct cpuinfo_x86 *c;
- if (!capable(CAP_SYS_RAWIO))
- return -EPERM;
- if (cpu >= nr_cpu_ids || !cpu_online(cpu))
- return -ENXIO; /* No such CPU */
- c = &cpu_data(cpu);
- if (!cpu_has(c, X86_FEATURE_MSR))
- return -EIO; /* MSR not supported */
- return 0;
- }
- SYSCALL_DEFINE0(vhangup)
- {
- if (capable(CAP_SYS_TTY_CONFIG)) {
- tty_vhangup_self();
- return 0;
- }
- return -EPERM;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement