]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/blame - fs/proc/cmdline.c
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[mirror_ubuntu-eoan-kernel.git] / fs / proc / cmdline.c
CommitLineData
b2441318 1// SPDX-License-Identifier: GPL-2.0
cf9887f1
AD
2#include <linux/fs.h>
3#include <linux/init.h>
4#include <linux/proc_fs.h>
5#include <linux/seq_file.h>
6
7static int cmdline_proc_show(struct seq_file *m, void *v)
8{
9 seq_printf(m, "%s\n", saved_command_line);
10 return 0;
11}
12
13static int cmdline_proc_open(struct inode *inode, struct file *file)
14{
15 return single_open(file, cmdline_proc_show, NULL);
16}
17
18static const struct file_operations cmdline_proc_fops = {
19 .open = cmdline_proc_open,
20 .read = seq_read,
21 .llseek = seq_lseek,
22 .release = single_release,
23};
24
25static int __init proc_cmdline_init(void)
26{
27 proc_create("cmdline", 0, NULL, &cmdline_proc_fops);
28 return 0;
29}
abaf3787 30fs_initcall(proc_cmdline_init);