diff -ruN kozos08/telnetd.c kozos09/telnetd.c --- kozos08/telnetd.c Sun Nov 4 11:27:46 2007 +++ kozos09/telnetd.c Sun Nov 4 11:27:46 2007 @@ -13,6 +13,7 @@ #define PORT 20001 int telnetd_id; +int telnetd_dummy; static int command_main(int s, char *argv[]) { @@ -41,6 +42,9 @@ if (!strncmp(buffer, "echo", 4)) { write(s, buffer + 4, strlen(buffer + 4)); + } else if (!strncmp(buffer, "break", 5)) { + int *nullp = NULL; + *nullp = 1; } else if (!strncmp(buffer, "date", 4)) { time_t t; t = time(NULL); @@ -51,7 +55,7 @@ int i; for (i = 0; i < THREAD_NUM; i++) { thp = &threads[i]; - if (!thp->id) break; + if (!thp->id) continue; write(s, thp->name, strlen(thp->name)); write(s, "\n", 1); } diff -ruN kozos08/thread.c kozos09/thread.c --- kozos08/thread.c Sun Nov 4 11:27:46 2007 +++ kozos09/thread.c Sun Nov 4 11:27:46 2007 @@ -398,9 +398,12 @@ case SIGTRAP: case SIGILL: { - fprintf(stderr, "error %s\n", current->name); + fprintf(stderr, "error thread \"%s\"\n", current->name); /* ダウン要因発生により継続不可能なので,スリープ状態にする*/ getcurrent(); +#if 1 /* スレッド終了する */ + thread_exit(); +#endif } break; default: @@ -434,6 +437,10 @@ signal(SIGSYS, thread_intr); signal(SIGHUP, thread_intr); signal(SIGALRM, thread_intr); + signal(SIGBUS, thread_intr); + signal(SIGSEGV, thread_intr); + signal(SIGTRAP, thread_intr); + signal(SIGILL, thread_intr); /* * current 未定のためにシステムコール発行はできないので,