5 #include <9p-mixp/err.h>
6 #include "mixp_local.h"
8 /* Approach to errno handling taken from Plan 9 Port. */
13 FILE* mixp_error_stream
= NULL
;
14 FILE* mixp_debug_stream
= NULL
;
20 errbuf
= mixp_thread
->errbuf();
22 strncpy(errbuf
, "interrupted", IXP_ERRMAX
);
23 else if(errno
!= EPLAN9
)
24 strncpy(errbuf
, strerror(errno
), IXP_ERRMAX
);
29 mixp_errstr(char *buf
, int n
) {
32 strncpy(tmp
, buf
, sizeof(tmp
));
34 strncpy(mixp_thread
->errbuf(), tmp
, IXP_ERRMAX
);
39 mixp_rerrstr(char *buf
, int n
) {
40 strncpy(buf
, mixp_errbuf(), n
);
44 mixp_werrstr(char *fmt
, ...) {
49 vsnprintf(tmp
, sizeof(tmp
), fmt
, ap
);
51 strncpy(mixp_thread
->errbuf(), tmp
, IXP_ERRMAX
);