diff options
Diffstat (limited to 'agent/command.c')
-rw-r--r-- | agent/command.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/agent/command.c b/agent/command.c index b816fac3e..9be814880 100644 --- a/agent/command.c +++ b/agent/command.c @@ -1344,6 +1344,7 @@ cmd_reloadagent (assuan_context_t ctx, char *line) Supported values for WHAT are: version - Return the version of the program. + pid - Return the process id of the server. socket_name - Return the name of the socket. ssh_socket_name - Return the name of the ssh socket. @@ -1358,6 +1359,13 @@ cmd_getinfo (assuan_context_t ctx, char *line) const char *s = VERSION; rc = assuan_send_data (ctx, s, strlen (s)); } + else if (!strcmp (line, "pid")) + { + char numbuf[50]; + + snprintf (numbuf, sizeof numbuf, "%lu", (unsigned long)getpid ()); + rc = assuan_send_data (ctx, numbuf, strlen (numbuf)); + } else if (!strcmp (line, "socket_name")) { const char *s = get_agent_socket_name (); |