1 /*
2 * Copyright (c) 2006-2023, RT-Thread Development Team
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 *
6 * Change Logs:
7 * Date Author Notes
8 */
9
10 #include "proc.h"
11 #include "procfs.h"
12
13 #include <rthw.h>
14 #include <rtdbg.h>
15
16 #include <fcntl.h>
17 #include <errno.h>
18
19 #include <dfs_dentry.h>
20
21
single_show(struct dfs_seq_file * seq,void * data)22 static int single_show(struct dfs_seq_file *seq, void *data)
23 {
24 dfs_seq_puts(seq, "\n \\ | /\n");
25 #ifdef RT_USING_SMART
26 dfs_seq_puts(seq, "- RT - Thread Smart Operating System\n");
27 #else
28 dfs_seq_puts(seq, "- RT - Thread Operating System\n");
29 #endif
30 dfs_seq_printf(seq, " / | \\ %d.%d.%d build %s %s\n",
31 (rt_int32_t)RT_VERSION_MAJOR, (rt_int32_t)RT_VERSION_MINOR, (rt_int32_t)RT_VERSION_PATCH,
32 __DATE__, __TIME__);
33 dfs_seq_puts(seq, " 2006 - 2022 Copyright by RT-Thread team\n");
34
35 return 0;
36 }
37
proc_version_init(void)38 int proc_version_init(void)
39 {
40 struct proc_dentry *dentry = proc_create_single_data("version", 0, NULL, single_show, NULL);
41 proc_release(dentry);
42
43 return 0;
44 }
45 INIT_ENV_EXPORT(proc_version_init);
46