1 /* Plan9 style error popping. For details, read Documentation/plan9.txt */
13 #define ERRSTACK(x) struct errbuf *prev_errbuf; struct errbuf errstack[(x)]; \
15 #define waserror() (errpush(errstack, ARRAY_SIZE(errstack), &curindex, \
17 setjmp(&(get_cur_errbuf()->jmpbuf)))
18 #define error(x,...) {set_errstr(x, ##__VA_ARGS__); \
19 longjmp(&get_cur_errbuf()->jmpbuf, 1);}
20 #define nexterror() {errpop(errstack, ARRAY_SIZE(errstack), &curindex, \
22 longjmp(&(get_cur_errbuf())->jmpbuf, 1);}
23 #define poperror() {errpop(errstack, ARRAY_SIZE(errstack), &curindex, \
26 int errpush(struct errbuf *errstack, int stacksize, int *curindex,
27 struct errbuf **prev_errbuf);
28 void errpop(struct errbuf *errstack, int stacksize, int *curindex,
29 struct errbuf *prev_errbuf);
31 #endif /* ROS_KERN_ERR_H */