![cinap_lenrek](/assets/img/avatar_default.png)
when _syserrno() fails to map a plan9 error string to a unix error number, we copy the plan9 error string to the per process error buffer "plan9err" and set errno = EPLAN9. when strerror() is called with EPLAN9, it returns a pointer to the plan9err buffer.
17 lines
224 B
C
17 lines
224 B
C
#include <stdarg.h>
|
|
#include <errno.h>
|
|
#include "fmt.h"
|
|
|
|
extern char *_plan9err;
|
|
|
|
void
|
|
werrstr(const char *fmt, ...)
|
|
{
|
|
va_list arg;
|
|
|
|
va_start(arg, fmt);
|
|
snprint(_plan9err, 128, fmt, arg);
|
|
va_end(arg);
|
|
errno = EPLAN9;
|
|
}
|