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