Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ shutdn(S) — OpenDesktop Software Development System 3.0.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

fsck(ADM)

haltsys(ADM)

kill(S)

mount(S)

shutdown(ADM)


 shutdn(S)                      6 January 1993                      shutdn(S)


 Name

    shutdn - flushes block I/O and halts the CPU

 Syntax


    cc  . . .  -lx


    #include  <sys/types.h>
    #include  <sys/param.h>
    #include  <sys/filsys.h>

    void shutdn (sblk, nsblk, arg);
    struct filsys *sblk, *nsblk;
    int arg;


 Description

    shutdn causes all information in memory that should be on disk to be
    written out.  This includes modified super blocks, modified inodes, and
    delayed block I/O.  The super blocks of all writable file systems are
    flagged `clean', so that they can be remounted without cleaning when the
    system is rebooted.  shutdn then prints Normal System Shutdown on the
    console and halts the CPU.

    The system then stays down or reboots dependent on whether arg is 0 or 1.

    If sblk is greater than 1, it specifies the address of a super block to
    be written to the root device as the last I/O before the halt, provided
    that nsblk is given as its bit-wise inverse.  This facility is provided
    to allow file system repair programs to supersede the system's copy of
    the root super block with one of their own.

    If sblk is 1, the second argument is a command and the third argument is
    the argument to the command.  The CONFPANIC command, a system configur-
    able system call, is given  the argument 0 to stay down, or 1 to reboot.
    When shutdn is called in this way, the purpose is not to bring down the
    system, but rather, to give instructions to the kernel regarding the way
    to deal with the next panic.

    shutdn locks out all other processes while it is doing its work.  How-
    ever, it is recommended that user processes be killed off (see kill(S))
    before calling shutdn as some types of disk activity could cause file
    systems to not be flagged ``clean''.

    The caller must be the super user.

 See also

    fsck(ADM), haltsys(ADM), kill(S), mount(S), shutdown(ADM)

 Standards conformance

    shutdn is not part of any currently supported standard; it is an exten-
    sion of AT&T System V provided by the Santa Cruz Operation.


Typewritten Software • bear@typewritten.org • Edmonds, WA 98026