man(1) Manual page archive


     ERROR(2)                                                 ERROR(2)

     NAME
          Error, stderr, error, panic, kill, checkload - Error
          handling and diagnostics

     SYNOPSIS
          include "error.m";
          err := load Error Error->PATH;

          init:     fn(s: Sys);
          kill:     fn (pid: int, msg: string): int;
          error: fn(e: string);
          panic: fn(e: string);
          checkload: fn[T](x: T, p: string): T;

          stderr: ref Sys->FD;

     DESCRIPTION
          Error provides functions used to deal with errors that are
          popular. Before any other thing, init must be called to ini-
          tialize the module.

          Kill writes the msg given to the control file for the pro-
          cess identified by pid. It returns -1 upon errors.

          The functions error and panic are similar. They print the
          given diagnostic to standard error and raise an expection.
          The second one will make the process break, for debugging.

          Checkload is intented to load a module and return it, check-
          ing out that the module did indeed load. In case of error it
          calls error with an appropriate message, using the second
          argument as the name of the file that could not be loaded.

          The global stderr is standard error, for use from other mod-
          ules as well.  Beware that using pctl(2) may leave stderr
          closed, despite being not null.

     SOURCE
          /usr/octopus/port/lib/error.b