diff options
author | Oliver Smith <osmith@sysmocom.de> | 2021-07-12 17:28:36 +0200 |
---|---|---|
committer | Oliver Smith <osmith@sysmocom.de> | 2021-07-15 12:51:44 +0200 |
commit | 0c78bc628eac2cf6f285869d10c238893185f956 (patch) | |
tree | 2dc1ca66f9dc48600c1266d72a053c686f407440 | |
parent | vty: add "show uptime" (diff) | |
download | libosmocore-0c78bc628eac2cf6f285869d10c238893185f956.tar.xz libosmocore-0c78bc628eac2cf6f285869d10c238893185f956.zip |
vty: add "show pid"
Related: OS#4609
Change-Id: Ib636050afc1eed134f450f2f1cdd3b51153b0160
-rw-r--r-- | src/vty/command.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/vty/command.c b/src/vty/command.c index 67b4001d..5001d06e 100644 --- a/src/vty/command.c +++ b/src/vty/command.c @@ -3041,6 +3041,13 @@ DEFUN(show_online_help, return CMD_SUCCESS; } +DEFUN(show_pid, + show_pid_cmd, "show pid", SHOW_STR "Displays the process ID\n") +{ + vty_out(vty, "%d%s", getpid(), VTY_NEWLINE); + return CMD_SUCCESS; +} + DEFUN(show_uptime, show_uptime_cmd, "show uptime", SHOW_STR "Displays how long the program has been running\n") { @@ -4367,6 +4374,7 @@ void cmd_init(int terminal) install_node(&config_node, config_write_host); /* Each node's basic commands. */ + install_lib_element(VIEW_NODE, &show_pid_cmd); install_lib_element(VIEW_NODE, &show_uptime_cmd); install_lib_element(VIEW_NODE, &show_version_cmd); install_lib_element(VIEW_NODE, &show_online_help_cmd); |