src/servers/init/init.c File Reference

#include <minix/type.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/stat.h>
#include <sys/svrctl.h>
#include <ttyent.h>
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <signal.h>
#include <string.h>
#include <time.h>
#include <stdlib.h>
#include <unistd.h>
#include <utmp.h>

Go to the source code of this file.

Classes

struct  slotent

Defines

#define PIDSLOTS   32
#define ERRCT_DISABLE   10
#define NO_PID   0
#define OPENFDS

Functions

void tell (int fd, char *s)
void report (int fd, char *label)
void wtmp (int type, int linenr, char *line, pid_t pid)
void startup (int linenr, struct ttyent *ttyp)
int execute (char **cmd)
void onhup (int sig)
void onterm (int sig)
void onabrt (int sig)
int main (void)

Variables

char * REBOOT_CMD [] = { "shutdown", "now", "CTRL-ALT-DEL", NULL }
struct ttyent TT_REBOOT = { "console", "-", REBOOT_CMD, NULL }
char PATH_UTMP [] = "/etc/utmp"
char PATH_WTMP [] = "/usr/adm/wtmp"
struct slotent slots [PIDSLOTS]
int gothup = 0
int gotabrt = 0
int spawn = 1


Define Documentation

#define ERRCT_DISABLE   10

Definition at line 48 of file init.c.

#define NO_PID   0

Definition at line 49 of file init.c.

#define OPENFDS

Value:

if (fstat(0, &stb) < 0) {                               \
        /* Open standard input, output & error. */      \
        (void) open("/dev/null", O_RDONLY);             \
        (void) open("/dev/log", O_WRONLY);              \
        dup(1);                                         \
  }

#define PIDSLOTS   32

Definition at line 41 of file init.c.


Function Documentation

int execute ( char **  cmd  ) 

Definition at line 341 of file init.c.

int main ( void   ) 

Definition at line 66 of file init.c.

void onabrt ( int  sig  ) 

Definition at line 210 of file init.c.

void onhup ( int  sig  ) 

Definition at line 199 of file init.c.

void onterm ( int  sig  ) 

Definition at line 205 of file init.c.

void report ( int  fd,
char *  label 
)

Definition at line 458 of file init.c.

void startup ( int  linenr,
struct ttyent ttyp 
)

Definition at line 218 of file init.c.

void tell ( int  fd,
char *  s 
)

Definition at line 451 of file init.c.

void wtmp ( int  type,
int  linenr,
char *  line,
pid_t  pid 
)

Definition at line 370 of file init.c.


Variable Documentation

int gotabrt = 0

Definition at line 54 of file init.c.

int gothup = 0

Definition at line 53 of file init.c.

char PATH_UTMP[] = "/etc/utmp"

Definition at line 38 of file init.c.

char PATH_WTMP[] = "/usr/adm/wtmp"

Definition at line 39 of file init.c.

char* REBOOT_CMD[] = { "shutdown", "now", "CTRL-ALT-DEL", NULL }

Definition at line 33 of file init.c.

struct slotent slots[PIDSLOTS]

Definition at line 51 of file init.c.

int spawn = 1

Definition at line 55 of file init.c.

struct ttyent TT_REBOOT = { "console", "-", REBOOT_CMD, NULL }

Definition at line 36 of file init.c.


Generated on Tue Mar 9 04:36:58 2010 for Minix by  doxygen 1.5.8