]> mj.ucw.cz Git - libucw.git/blob - ucw/process.h
setproctitle: Copy all arguments in setproctitle_init()
[libucw.git] / ucw / process.h
1 /*
2  *      UCW Library -- Processes
3  *
4  *      (c) 2012 Martin Mares <mj@ucw.cz>
5  *
6  *      This software may be freely distributed and used according to the terms
7  *      of the GNU Lesser General Public License.
8  */
9
10 #ifndef _UCW_PROCESS_H
11 #define _UCW_PROCESS_H
12
13 /* proctitle.c */
14
15 // Must be called before parsing of arguments
16 void setproctitle_init(int argc, char **argv);
17 void setproctitle(const char *msg, ...) FORMAT_CHECK(printf,1,2);
18 char *getproctitle(void);
19
20 /* exitstatus.c */
21
22 #define EXIT_STATUS_MSG_SIZE 64
23 int format_exit_status(char *msg, int stat);
24
25 /* runcmd.c */
26
27 int run_command(const char *cmd, ...);
28 void NONRET exec_command(const char *cmd, ...);
29 void echo_command(char *buf, int size, const char *cmd, ...);
30 int run_command_v(const char *cmd, va_list args);
31 void NONRET exec_command_v(const char *cmd, va_list args);
32 void echo_command_v(char *buf, int size, const char *cmd, va_list args);
33
34 #endif  /* !_UCW_PROCESS_H */