b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame^] | 1 | // SPDX-License-Identifier: GPL-2.0 |
| 2 | #include <linux/fs.h> |
| 3 | #include <linux/init.h> |
| 4 | #include <linux/kernel.h> |
| 5 | #include <linux/proc_fs.h> |
| 6 | #include <linux/seq_file.h> |
| 7 | #include <linux/utsname.h> |
| 8 | |
| 9 | static int version_proc_show(struct seq_file *m, void *v) |
| 10 | { |
| 11 | seq_printf(m, linux_proc_banner, |
| 12 | utsname()->sysname, |
| 13 | utsname()->release, |
| 14 | utsname()->version); |
| 15 | return 0; |
| 16 | } |
| 17 | |
| 18 | static int __init proc_version_init(void) |
| 19 | { |
| 20 | proc_create_single("version", 0, NULL, version_proc_show); |
| 21 | return 0; |
| 22 | } |
| 23 | fs_initcall(proc_version_init); |