Fix 'include' issue
authorBarret Rhoden <brho@cs.berkeley.edu>
Thu, 11 Jan 2018 17:33:08 +0000 (12:33 -0500)
committerBarret Rhoden <brho@cs.berkeley.edu>
Mon, 26 Feb 2018 22:05:28 +0000 (17:05 -0500)
If you tried to use error() without including syscall.h, it would fail to
compile.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/include/err.h

index 6b10c40..7c9f14c 100644 (file)
                     int curindex = 0;
 #define waserror() setjmp(&(errpush(errstack, ARRAY_SIZE(errstack), &curindex, \
                                                                        &prev_errbuf)->jmpbuf))
+
+/* In syscall.h, but want to avoid circular include issues. */
+extern void set_error(int error, const char *fmt, ...);
+extern struct errbuf *get_cur_errbuf(void);
+
 #define error(e, x, ...)                                                                                               \
        do {                                                                                                                            \
                set_error(e, x, ##__VA_ARGS__);                                                                 \