]>
git.ipfire.org Git - people/ms/systemd.git/blob - initreq.h
2 * initreq.h Interface to talk to init through /dev/initctl.
4 * Copyright (C) 1995-2004 Miquel van Smoorenburg
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * Version: @(#)initreq.h 1.28 31-Mar-2004 MvS
17 #include <sys/param.h>
19 #if defined(__FreeBSD_kernel__)
20 # define INIT_FIFO "/etc/.initctl"
22 # define INIT_FIFO "/dev/initctl"
25 #define INIT_MAGIC 0x03091969
26 #define INIT_CMD_START 0
27 #define INIT_CMD_RUNLVL 1
28 #define INIT_CMD_POWERFAIL 2
29 #define INIT_CMD_POWERFAILNOW 3
30 #define INIT_CMD_POWEROK 4
31 #define INIT_CMD_BSD 5
32 #define INIT_CMD_SETENV 6
33 #define INIT_CMD_UNSETENV 7
35 #define INIT_CMD_CHANGECONS 12345
38 # define INITRQ_HLEN MAXHOSTNAMELEN
40 # define INITRQ_HLEN 64
44 * This is what BSD 4.4 uses when talking to init.
45 * Linux doesn't use this right now.
47 struct init_request_bsd
{
48 char gen_id
[8]; /* Beats me.. telnetd uses "fe" */
49 char tty_id
[16]; /* Tty name minus /dev/tty */
50 char host
[INITRQ_HLEN
]; /* Hostname */
51 char term_type
[16]; /* Terminal type */
52 int signal
; /* Signal to send */
53 int pid
; /* Process to send to */
54 char exec_name
[128]; /* Program to execute */
55 char reserved
[128]; /* For future expansion. */
60 * Because of legacy interfaces, "runlevel" and "sleeptime"
61 * aren't in a seperate struct in the union.
63 * The weird sizes are because init expects the whole
64 * struct to be 384 bytes.
67 int magic
; /* Magic number */
68 int cmd
; /* What kind of request */
69 int runlevel
; /* Runlevel to change to */
70 int sleeptime
; /* Time between TERM and KILL */
72 struct init_request_bsd bsd
;