proc_version.c 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. #include "proc.h"
  10. #include "procfs.h"
  11. #include <rthw.h>
  12. #include <rtdbg.h>
  13. #include <fcntl.h>
  14. #include <errno.h>
  15. #include <dfs_dentry.h>
  16. static int single_show(struct dfs_seq_file *seq, void *data)
  17. {
  18. dfs_seq_puts(seq, "\n \\ | /\n");
  19. #ifdef RT_USING_SMART
  20. dfs_seq_puts(seq, "- RT - Thread Smart Operating System\n");
  21. #else
  22. dfs_seq_puts(seq, "- RT - Thread Operating System\n");
  23. #endif
  24. dfs_seq_printf(seq, " / | \\ %d.%d.%d build %s %s\n",
  25. (rt_int32_t)RT_VERSION_MAJOR, (rt_int32_t)RT_VERSION_MINOR, (rt_int32_t)RT_VERSION_PATCH,
  26. __DATE__, __TIME__);
  27. dfs_seq_puts(seq, " 2006 - 2022 Copyright by RT-Thread team\n");
  28. return 0;
  29. }
  30. int proc_version_init(void)
  31. {
  32. struct proc_dentry *dentry = proc_create_single_data("version", 0, NULL, single_show, NULL);
  33. proc_release(dentry);
  34. return 0;
  35. }
  36. INIT_ENV_EXPORT(proc_version_init);