Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
Alexey Dobriyan | cf9887f | 2008-10-04 14:13:59 +0400 | [diff] [blame] | 2 | #include <linux/fs.h> |
| 3 | #include <linux/init.h> |
| 4 | #include <linux/proc_fs.h> |
| 5 | #include <linux/seq_file.h> |
| 6 | |
| 7 | static int cmdline_proc_show(struct seq_file *m, void *v) |
| 8 | { |
Alexey Dobriyan | 58c501a | 2018-04-10 16:32:01 -0700 | [diff] [blame] | 9 | seq_puts(m, saved_command_line); |
| 10 | seq_putc(m, '\n'); |
Alexey Dobriyan | cf9887f | 2008-10-04 14:13:59 +0400 | [diff] [blame] | 11 | return 0; |
| 12 | } |
| 13 | |
Alexey Dobriyan | cf9887f | 2008-10-04 14:13:59 +0400 | [diff] [blame] | 14 | static int __init proc_cmdline_init(void) |
| 15 | { |
Christoph Hellwig | 3f3942a | 2018-05-15 15:57:23 +0200 | [diff] [blame] | 16 | proc_create_single("cmdline", 0, NULL, cmdline_proc_show); |
Alexey Dobriyan | cf9887f | 2008-10-04 14:13:59 +0400 | [diff] [blame] | 17 | return 0; |
| 18 | } |
Paul Gortmaker | abaf378 | 2014-01-23 15:55:45 -0800 | [diff] [blame] | 19 | fs_initcall(proc_cmdline_init); |