2 * We assume there's only one error buffer for the whole system.
3 * If you use ffork, you need to provide a _syserrstr. Since most
4 * people will use libthread (which provides a _syserrstr), this is
18 char *(*_syserrstr)(void);
19 static char xsyserr[ERRMAX];
34 errstr(char *err, uint n)
39 strecpy(tmp, tmp+ERRMAX, err);
42 strecpy(syserr, syserr+ERRMAX, tmp);
48 rerrstr(char *err, uint n)
54 strcpy(syserr, "interrupted");
55 else if(errno != EPLAN9)
56 strcpy(syserr, strerror(errno));
57 strecpy(err, err+n, syserr);
60 /* replaces __errfmt in libfmt */
66 return fmtstrcpy(f, getsyserr());
67 return fmtstrcpy(f, strerror(errno));
71 werrstr(char *fmt, ...)
77 vseprint(buf, buf+ERRMAX, fmt, arg);