(udata.u_ptab->p_uid == (p)->p_uid || super())
#define pathbuf() tmpbuf()
#define pathfree(tb) brelse(tb)
-#define dump_core(sig)
+#define dump_core(sig) sig
#endif
#define WNOHANG 1
#define WUNTRACED 2
#define _WSTOPPED 0xFF
+#define W_COREDUMP 0x80
/* Open() parameters. */
extern arg_t _getsid(void);
/* Provided by the execve support */
-extern void write_core_image(void);
+extern uint8_t write_core_image(void);
/* This will change a lot in future ! */
struct coredump {
}
#ifdef CONFIG_LEVEL_2
-static void dump_core(uint8_t sig)
+static uint8_t dump_core(uint8_t sig)
{
if (!(udata.u_flags & U_FLAG_NOCORE) && ((sig == SIGQUIT || sig == SIGILL || sig == SIGTRAP ||
sig == SIGABRT || sig == SIGBUS || sig == SIGFPE ||
sig == SIGSEGV || sig == SIGXCPU || sig == SIGXFSZ ||
sig == SIGSYS))) {
- write_core_image();
+ return sig | write_core_image();
}
+ return sig;
}
#endif
#ifdef DEBUG
kprintf("process terminated by signal %d\n", j);
#endif
- dump_core(j);
- doexit((uint16_t)j << 8);
+ doexit(dump_core(j));
} else if (*svec != SIG_IGN) {
/* Arrange to call the user routine at return */
udata.u_ptab->p_pending &= ~m; // unset the bit