"Fossies" - the Fresh Open Source Software Archive

Member "sysvinit-2.99/src/initreq.h" (21 Feb 2021, 2446 Bytes) of package /linux/misc/sysvinit-2.99.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "initreq.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 2.98_vs_2.99.

    1 /*
    2  * initreq.h    Interface to talk to init through /run/initctl.
    3  *
    4  *      Copyright (C) 1995-2004 Miquel van Smoorenburg
    5  *
    6  *      This program is free software; you can redistribute it and/or modify
    7  *      it under the terms of the GNU General Public License as published by
    8  *      the Free Software Foundation; either version 2 of the License, or
    9  *      (at your option) any later version.
   10  *
   11  *      This program is distributed in the hope that it will be useful,
   12  *      but WITHOUT ANY WARRANTY; without even the implied warranty of
   13  *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   14  *      GNU General Public License for more details.
   15  *
   16  *      You should have received a copy of the GNU General Public License
   17  *      along with this program; if not, write to the Free Software
   18  *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
   19  *
   20  * Version:     @(#)initreq.h  1.28  31-Mar-2004 MvS
   21  *
   22  */
   23 #ifndef _INITREQ_H
   24 #define _INITREQ_H
   25 
   26 #include <sys/param.h>
   27 
   28 #ifndef INIT_FIFO
   29 #define INIT_FIFO  "/run/initctl"
   30 #endif
   31 
   32 #define INIT_MAGIC 0x03091969
   33 #define INIT_CMD_START      0
   34 #define INIT_CMD_RUNLVL     1
   35 #define INIT_CMD_POWERFAIL  2
   36 #define INIT_CMD_POWERFAILNOW   3
   37 #define INIT_CMD_POWEROK    4
   38 #define INIT_CMD_BSD        5
   39 #define INIT_CMD_SETENV     6
   40 #define INIT_CMD_UNSETENV   7
   41 
   42 #ifdef MAXHOSTNAMELEN
   43 #  define INITRQ_HLEN   MAXHOSTNAMELEN
   44 #else
   45 #  define INITRQ_HLEN   64
   46 #endif
   47 
   48 /*
   49  *  This is what BSD 4.4 uses when talking to init.
   50  *  Linux doesn't use this right now.
   51  */
   52 struct init_request_bsd {
   53     char    gen_id[8];      /* Beats me.. telnetd uses "fe" */
   54     char    tty_id[16];     /* Tty name minus /dev/tty      */
   55     char    host[INITRQ_HLEN];  /* Hostname                     */
   56     char    term_type[16];      /* Terminal type                */
   57     int signal;         /* Signal to send               */
   58     int pid;            /* Process to send to           */
   59     char    exec_name[128];         /* Program to execute           */
   60     char    reserved[128];      /* For future expansion.        */
   61 };
   62 
   63 
   64 /*
   65  *  Because of legacy interfaces, "runlevel" and "sleeptime"
   66  *  aren't in a separate struct in the union.
   67  *
   68  *  The weird sizes are because init expects the whole
   69  *  struct to be 384 bytes.
   70  */
   71 struct init_request {
   72     int magic;          /* Magic number                 */
   73     int cmd;            /* What kind of request         */
   74     int runlevel;       /* Runlevel to change to        */
   75     int sleeptime;      /* Time between TERM and KILL   */
   76     union {
   77         struct init_request_bsd bsd;
   78         char            data[368];
   79     } i;
   80 };
   81 
   82 #endif