Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ extended_perror(3C) — DG/UX R4.11

Media Vault

Software Library

Restoration Projects

Artifacts Sought



extended_perror(3C)               SDK R4.11              extended_perror(3C)


NAME
       extendedperror - print an error message to standard error

SYNOPSIS
       void extendedperror();
       char *string;
       ...
       extendedperror(string);

   where:
       string    A pointer to a null-terminated string that is printed
                 (along with a colon) before the error message is printed

DESCRIPTION
       The extendedperror function prints to the standard error file a
       string and an error message corresponding to the last DG/UX extended
       error with the dgexterrno function.  If no extended error message
       is available, nothing is printed.

RETURNS
       The extendedperror function returns no value.

EXAMPLE
       The following program copies data from the tape drive to the standard
       output.  If an error occurs, the extendedperror function prints an
       error message.

       /* Program test for the extendedperror() function */

       #include <fcntl.h>


       #define MBUF   32768
       #define STDOUT 1

       char buf[MBUF];
       void perror(), extendedperror();
       int read(), write();

       main() {
           int len, fd = open("/dev/rmt/0", ORDONLY);

           if (fd == -1) {
               perror("Open of /dev/rmt/0");
               return 1;
           }
           while ((len = read(fd, buf, MBUF)) > 0) {
               if (write(STDOUT, buf, len) < 0) {
                   perror("Write to stdout");
                   return 1;
               }
           }
           if (len < 0) {
               extendedperror("Read of /dev/rmt/0");
               return 1;
           }
           return 0;
       }

FILES
       /usr/lib/nls/msg/locale/exterr.cat -- message catalog.

SEE ALSO
       See also the perror function.
       dgexterrno(2), extendedstrerror(3C).


Licensed material--property of copyright holder(s)

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