| * We assume there's only one error buffer for the whole system. |
| * If you use ffork, you need to provide a _syserrstr. Since most |
| * people will use libthread (which provides a _syserrstr), this is |
| char *(*_syserrstr)(void); |
| static char xsyserr[ERRMAX]; |
| errstr(char *err, uint n) |
| strecpy(tmp, tmp+ERRMAX, err); |
| strecpy(syserr, syserr+ERRMAX, tmp); |
| rerrstr(char *err, uint n) |
| strcpy(syserr, "interrupted"); |
| strcpy(syserr, strerror(errno)); |
| strecpy(err, err+n, syserr); |
| /* replaces __errfmt in libfmt */ |
| return fmtstrcpy(f, getsyserr()); |
| return fmtstrcpy(f, strerror(errno)); |
| vseprint(buf, buf+ERRMAX, fmt, arg); |