]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/shared/initreq.h
hwdb: Add mapping for Xiaomi Mipad 2 bottom bezel capacitive buttons
[thirdparty/systemd.git] / src / shared / initreq.h
1 /* SPDX-License-Identifier: LGPL-2.0-or-later */
2 /*
3 * Copyright (C) 1995-2004 Miquel van Smoorenburg
4 * Version: @(#)initreq.h 1.28 31-Mar-2004 MvS
5 */
6
7 #pragma once
8
9 #include <sys/param.h>
10
11 #if defined(__FreeBSD_kernel__)
12 # define INIT_FIFO "/etc/.initctl"
13 #else
14 # define INIT_FIFO "/dev/initctl"
15 #endif
16
17 #define INIT_MAGIC 0x03091969
18 #define INIT_CMD_START 0
19 #define INIT_CMD_RUNLVL 1
20 #define INIT_CMD_POWERFAIL 2
21 #define INIT_CMD_POWERFAILNOW 3
22 #define INIT_CMD_POWEROK 4
23 #define INIT_CMD_BSD 5
24 #define INIT_CMD_SETENV 6
25 #define INIT_CMD_UNSETENV 7
26
27 #define INIT_CMD_CHANGECONS 12345
28
29 #ifdef MAXHOSTNAMELEN
30 # define INITRQ_HLEN MAXHOSTNAMELEN
31 #else
32 # define INITRQ_HLEN 64
33 #endif
34
35 /*
36 * This is what BSD 4.4 uses when talking to init.
37 * Linux doesn't use this right now.
38 */
39 struct init_request_bsd {
40 char gen_id[8]; /* Beats me.. telnetd uses "fe" */
41 char tty_id[16]; /* Tty name minus /dev/tty */
42 char host[INITRQ_HLEN]; /* Hostname */
43 char term_type[16]; /* Terminal type */
44 int signal; /* Signal to send */
45 int pid; /* Process to send to */
46 char exec_name[128]; /* Program to execute */
47 char reserved[128]; /* For future expansion. */
48 };
49
50 /*
51 * Because of legacy interfaces, "runlevel" and "sleeptime"
52 * aren't in a separate struct in the union.
53 *
54 * The weird sizes are because init expects the whole
55 * struct to be 384 bytes.
56 */
57 struct init_request {
58 int magic; /* Magic number */
59 int cmd; /* What kind of request */
60 int runlevel; /* Runlevel to change to */
61 int sleeptime; /* Time between TERM and KILL */
62 union {
63 struct init_request_bsd bsd;
64 char data[368];
65 } i;
66 };