2017-11-01 15:07:57 +01:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2008-10-04 14:13:59 +04:00
|
|
|
#include <linux/fs.h>
|
|
|
|
|
#include <linux/init.h>
|
|
|
|
|
#include <linux/proc_fs.h>
|
|
|
|
|
#include <linux/seq_file.h>
|
2022-09-08 21:21:54 +03:00
|
|
|
#include "internal.h"
|
2008-10-04 14:13:59 +04:00
|
|
|
|
|
|
|
|
static int cmdline_proc_show(struct seq_file *m, void *v)
|
|
|
|
|
{
|
2018-04-10 16:32:01 -07:00
|
|
|
seq_puts(m, saved_command_line);
|
|
|
|
|
seq_putc(m, '\n');
|
2008-10-04 14:13:59 +04:00
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int __init proc_cmdline_init(void)
|
|
|
|
|
{
|
2022-09-08 21:21:54 +03:00
|
|
|
struct proc_dir_entry *pde;
|
|
|
|
|
|
|
|
|
|
pde = proc_create_single("cmdline", 0, NULL, cmdline_proc_show);
|
2022-12-30 12:36:02 +03:00
|
|
|
pde_make_permanent(pde);
|
2022-09-08 21:21:54 +03:00
|
|
|
pde->size = saved_command_line_len + 1;
|
2008-10-04 14:13:59 +04:00
|
|
|
return 0;
|
|
|
|
|
}
|
2014-01-23 15:55:45 -08:00
|
|
|
fs_initcall(proc_cmdline_init);
|