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
17 char *(*_syserrstr)(void);
18 static char xsyserr[ERRMAX];
33 errstr(char *err, uint n)
40 strcpy(syserr, strerror(errno));
42 strecpy(tmp, tmp+ERRMAX, syserr);
43 strecpy(syserr, syserr+ERRMAX, err);
44 strecpy(err, err+n, tmp);
50 rerrstr(char *err, uint n)
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));