Expand PMF_FN_* macros.
[netbsd-mini2440.git] / external / ibm-public / postfix / dist / src / global / debug_process.c
blobc0b3db4c0fb46ed1fb8225b68f3610c4982b87ab
1 /* $NetBSD$ */
3 /*++
4 /* NAME
5 /* debug_process 3
6 /* SUMMARY
7 /* run an external debugger
8 /* SYNOPSIS
9 /* #include <debug_process.h>
11 /* char *debug_process()
12 /* DESCRIPTION
13 /* debug_process() runs a debugger, as specified in the
14 /* \fIdebugger_command\fR configuration variable.
16 /* Examples of non-interactive debuggers are call tracing tools
17 /* such as: trace, strace or truss.
19 /* Examples of interactive debuggers are xxgdb, xxdbx, and so on.
20 /* In order to use an X-based debugger, the process must have a
21 /* properly set up XAUTHORITY environment variable.
22 /* LICENSE
23 /* .ad
24 /* .fi
25 /* The Secure Mailer license must be distributed with this software.
26 /* AUTHOR(S)
27 /* Wietse Venema
28 /* IBM T.J. Watson Research
29 /* P.O. Box 704
30 /* Yorktown Heights, NY 10598, USA
31 /*--*/
33 /* System library. */
35 #include <sys_defs.h>
36 #include <string.h>
37 #include <stdlib.h>
38 #include <unistd.h>
40 /* Utility library. */
42 #include <msg.h>
44 /* Global library. */
46 #include "mail_params.h"
47 #include "mail_conf.h"
48 #include "debug_process.h"
50 /* debug_process - run a debugger on this process */
52 void debug_process(void)
54 const char *command;
57 * Expand $debugger_command then run it.
59 command = mail_conf_lookup_eval(VAR_DEBUG_COMMAND);
60 if (command == 0 || *command == 0)
61 msg_fatal("no %s variable set up", VAR_DEBUG_COMMAND);
62 msg_info("running: %s", command);
63 system(command);