1 // SPDX-License-Identifier: GPL-2.0
3 #include <linux/init.h>
4 #include <linux/proc_fs.h>
5 #include <linux/seq_file.h>
7 static int cmdline_proc_show(struct seq_file
*m
, void *v
)
9 seq_printf(m
, "%s\n", saved_command_line
);
13 static int cmdline_proc_open(struct inode
*inode
, struct file
*file
)
15 return single_open(file
, cmdline_proc_show
, NULL
);
18 static const struct file_operations cmdline_proc_fops
= {
19 .open
= cmdline_proc_open
,
22 .release
= single_release
,
25 static int __init
proc_cmdline_init(void)
27 proc_create("cmdline", 0, NULL
, &cmdline_proc_fops
);
30 fs_initcall(proc_cmdline_init
);