summaryrefslogtreecommitdiffstats
path: root/login-utils/simpleinit.h
blob: ff26480f726134b103b9e9292d83181fe527a758 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <limits.h>
#include <errno.h>


#define ERRSTRING strerror (errno)
#define COMMAND_SIZE  (PIPE_BUF - 4)


#define COMMAND_TEST       0  /*  No wait, signal                            */
#define COMMAND_NEED       1  /*  Wait, signal                               */
#define COMMAND_ROLLBACK   2  /*  Wait, signal                               */
#define COMMAND_DUMP_LIST  3  /*  No wait, no signal                         */

#define SIG_PRESENT        SIGUSR1  /*  Service is available                 */
#define SIG_STOPPED        SIGUSR1  /*  Service was stopped OK               */
#define SIG_NOT_PRESENT    SIGUSR2  /*  Not present, but that's OK           */
#define SIG_FAILED         SIGPOLL  /*  Startup failed                       */
#define SIG_NOT_STOPPED    SIGPOLL  /*  Failed to stop                       */

struct command_struct  /*  Must always be COMMAND_SIZE  */
{
    signed int command;
    pid_t pid;
    char name[1];
};