Annotation of 42BSD/usr.lib/libU77/gerror_.c, revision 1.1

1.1     ! root        1: /*
        !             2: char id_gerror[] = "@(#)gerror_.c      1.1";
        !             3:  *
        !             4:  * Return a standard error message in a character string.
        !             5:  *
        !             6:  * calling sequence:
        !             7:  *     call gerror (string)
        !             8:  * or
        !             9:  *     character*20 gerror, string
        !            10:  *     string = gerror()
        !            11:  * where:
        !            12:  *     'string' will receive the standard error message
        !            13:  */
        !            14: 
        !            15: #include       <stdio.h>
        !            16: #include       "../libI77/f_errno.h"
        !            17: 
        !            18: extern char *sys_errlist[];
        !            19: extern int sys_nerr;
        !            20: extern char *f_errlist[];
        !            21: extern int f_nerr;
        !            22: 
        !            23: gerror_(s, len)
        !            24: char *s; long len;
        !            25: {
        !            26:        char *mesg;
        !            27: 
        !            28:        if (errno >=0 && errno < sys_nerr)
        !            29:                mesg = sys_errlist[errno];
        !            30:        else if (errno >= F_ER && errno < (F_ER + f_nerr))
        !            31:                mesg = f_errlist[errno - F_ER];
        !            32:        else
        !            33:                mesg = "unknown error number";
        !            34:        b_char(mesg, s, len);
        !            35: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.