diff -ruN kozos25.orig/Makefile kozos25/Makefile
--- kozos25.orig/Makefile	2007-12-05 22:16:58.000000000 +0900
+++ kozos25/Makefile	2007-12-04 23:17:04.000000000 +0900
@@ -13,15 +13,15 @@
 
 all :		$(TARGET)
 
-$(TARGET) :	$(OBJS) t2w
+$(TARGET) :	$(OBJS) #t2w
 		$(CC) $(OBJS) -o $(TARGET) $(CFLAGS)
-		./t2w $(TARGET)
+#		./t2w $(TARGET)
 
 .c.o :		$<
 		$(CC) -c $< $(CFLAGS)
 
-t2w :		t2w.c
-		$(CC) t2w.c -o t2w -Wall
+#t2w :		t2w.c
+#		$(CC) t2w.c -o t2w -Wall
 
 clean :
 		rm -f $(OBJS) $(TARGET) t2w
diff -ruN kozos25.orig/extintr.c kozos25/extintr.c
--- kozos25.orig/extintr.c	2007-12-05 22:16:58.000000000 +0900
+++ kozos25/extintr.c	2007-12-04 22:51:24.000000000 +0900
@@ -107,7 +107,7 @@
   ibp->id = id;
   if (addrp) {
     ibp->type = INTR_TYPE_ACCEPT;
-    memcpy(&ibp->addr, addrp, addrp->sa_len);
+    memcpy(&ibp->addr, addrp, sizeof(*addrp));
   } else {
     ibp->type = INTR_TYPE_READ;
     memset(&ibp->addr, 0, sizeof(ibp->addr));
@@ -147,7 +147,7 @@
 	  if (FD_ISSET(ibp->fd, &fds)) {
 	    switch (ibp->type) {
 	    case INTR_TYPE_ACCEPT:
-	      len = ibp->addr.sa_len;
+	      len = sizeof(ibp->addr);
 	      s = accept(ibp->fd, &ibp->addr, &len);
 	      if (s > 0)
 		kz_send(ibp->id, s, NULL);
diff -ruN kozos25.orig/httpd.c kozos25/httpd.c
--- kozos25.orig/httpd.c	2007-12-05 22:16:58.000000000 +0900
+++ kozos25/httpd.c	2007-12-04 22:56:53.000000000 +0900
@@ -72,7 +72,7 @@
 
   memset(&address, 0, sizeof(address));
   address.sin_family = AF_INET;
-  address.sin_len = sizeof(address);
+  /* address.sin_len = sizeof(address); */
   address.sin_port = htons(PORT);
   memcpy(&(address.sin_addr), host->h_addr, host->h_length);
 
diff -ruN kozos25.orig/stubd.c kozos25/stubd.c
--- kozos25.orig/stubd.c	2007-12-05 22:16:58.000000000 +0900
+++ kozos25/stubd.c	2007-12-04 22:55:05.000000000 +0900
@@ -34,7 +34,7 @@
 
   memset(&address, 0, sizeof(address));
   address.sin_family = AF_INET;
-  address.sin_len = sizeof(address);
+  /* address.sin_len = sizeof(address); */
   address.sin_port = htons(PORT);
   memcpy(&(address.sin_addr), host->h_addr, host->h_length);
 
diff -ruN kozos25.orig/stublib.c kozos25/stublib.c
--- kozos25.orig/stublib.c	2007-12-05 22:16:58.000000000 +0900
+++ kozos25/stublib.c	2007-12-04 23:15:14.000000000 +0900
@@ -3,6 +3,7 @@
 #include <string.h>
 #include <unistd.h>
 
+#define __USE_GNU
 #include "kozos.h"
 #include "thread.h"
 #include "stublib.h"
@@ -101,42 +102,42 @@
 {
   memset(registers, 0, sizeof(registers));
 
-  registers[EAX] = thp->context.uap.uc_mcontext.mc_eax;
-  registers[ECX] = thp->context.uap.uc_mcontext.mc_ecx;
-  registers[EDX] = thp->context.uap.uc_mcontext.mc_edx;
-  registers[EBX] = thp->context.uap.uc_mcontext.mc_ebx;
-  registers[ESP] = thp->context.uap.uc_mcontext.mc_esp;
-  registers[EBP] = thp->context.uap.uc_mcontext.mc_ebp;
-  registers[ESI] = thp->context.uap.uc_mcontext.mc_esi;
-  registers[EDI] = thp->context.uap.uc_mcontext.mc_edi;
-  registers[PC]  = thp->context.uap.uc_mcontext.mc_eip;
-  registers[PS]  = thp->context.uap.uc_mcontext.mc_eflags;
-  registers[CS]  = thp->context.uap.uc_mcontext.mc_cs;
-  registers[SS]  = thp->context.uap.uc_mcontext.mc_ss;
-  registers[DS]  = thp->context.uap.uc_mcontext.mc_ds;
-  registers[ES]  = thp->context.uap.uc_mcontext.mc_es;
-  registers[FS]  = thp->context.uap.uc_mcontext.mc_fs;
-  registers[GS]  = thp->context.uap.uc_mcontext.mc_gs;
+  registers[EAX] = thp->context.uap.uc_mcontext.gregs[REG_EAX];
+  registers[ECX] = thp->context.uap.uc_mcontext.gregs[REG_ECX];
+  registers[EDX] = thp->context.uap.uc_mcontext.gregs[REG_EDX];
+  registers[EBX] = thp->context.uap.uc_mcontext.gregs[REG_EBX];
+  registers[ESP] = thp->context.uap.uc_mcontext.gregs[REG_ESP];
+  registers[EBP] = thp->context.uap.uc_mcontext.gregs[REG_EBP];
+  registers[ESI] = thp->context.uap.uc_mcontext.gregs[REG_ESI];
+  registers[EDI] = thp->context.uap.uc_mcontext.gregs[REG_EDI];
+  registers[PC]  = thp->context.uap.uc_mcontext.gregs[REG_EIP];
+  registers[PS]  = thp->context.uap.uc_mcontext.gregs[REG_EFL];
+  registers[CS]  = thp->context.uap.uc_mcontext.gregs[REG_CS];
+  registers[SS]  = thp->context.uap.uc_mcontext.gregs[REG_SS];
+  registers[DS]  = thp->context.uap.uc_mcontext.gregs[REG_DS];
+  registers[ES]  = thp->context.uap.uc_mcontext.gregs[REG_ES];
+  registers[FS]  = thp->context.uap.uc_mcontext.gregs[REG_FS];
+  registers[GS]  = thp->context.uap.uc_mcontext.gregs[REG_GS];
 }
 
 void stub_restore_regs(kz_thread *thp)
 {
-  thp->context.uap.uc_mcontext.mc_eax    = registers[EAX];
-  thp->context.uap.uc_mcontext.mc_ecx    = registers[ECX];
-  thp->context.uap.uc_mcontext.mc_edx    = registers[EDX];
-  thp->context.uap.uc_mcontext.mc_ebx    = registers[EBX];
-  thp->context.uap.uc_mcontext.mc_esp    = registers[ESP];
-  thp->context.uap.uc_mcontext.mc_ebp    = registers[EBP];
-  thp->context.uap.uc_mcontext.mc_esi    = registers[ESI];
-  thp->context.uap.uc_mcontext.mc_edi    = registers[EDI];
-  thp->context.uap.uc_mcontext.mc_eip    = registers[PC];
-  thp->context.uap.uc_mcontext.mc_eflags = registers[PS];
-  thp->context.uap.uc_mcontext.mc_cs     = registers[CS];
-  thp->context.uap.uc_mcontext.mc_ss     = registers[SS];
-  thp->context.uap.uc_mcontext.mc_ds     = registers[DS];
-  thp->context.uap.uc_mcontext.mc_es     = registers[ES];
-  thp->context.uap.uc_mcontext.mc_fs     = registers[FS];
-  thp->context.uap.uc_mcontext.mc_gs     = registers[GS];
+  thp->context.uap.uc_mcontext.gregs[REG_EAX] = registers[EAX];
+  thp->context.uap.uc_mcontext.gregs[REG_ECX] = registers[ECX];
+  thp->context.uap.uc_mcontext.gregs[REG_EDX] = registers[EDX];
+  thp->context.uap.uc_mcontext.gregs[REG_EBX] = registers[EBX];
+  thp->context.uap.uc_mcontext.gregs[REG_ESP] = registers[ESP];
+  thp->context.uap.uc_mcontext.gregs[REG_EBP] = registers[EBP];
+  thp->context.uap.uc_mcontext.gregs[REG_ESI] = registers[ESI];
+  thp->context.uap.uc_mcontext.gregs[REG_EDI] = registers[EDI];
+  thp->context.uap.uc_mcontext.gregs[REG_EIP] = registers[PC];
+  thp->context.uap.uc_mcontext.gregs[REG_EFL] = registers[PS];
+  thp->context.uap.uc_mcontext.gregs[REG_CS]  = registers[CS];
+  thp->context.uap.uc_mcontext.gregs[REG_SS]  = registers[SS];
+  thp->context.uap.uc_mcontext.gregs[REG_DS]  = registers[DS];
+  thp->context.uap.uc_mcontext.gregs[REG_ES]  = registers[ES];
+  thp->context.uap.uc_mcontext.gregs[REG_FS]  = registers[FS];
+  thp->context.uap.uc_mcontext.gregs[REG_GS]  = registers[GS];
 }
 
 int stub_proc(kz_thread *thp, int signo)
diff -ruN kozos25.orig/telnetd.c kozos25/telnetd.c
--- kozos25.orig/telnetd.c	2007-12-05 22:16:58.000000000 +0900
+++ kozos25/telnetd.c	2007-12-04 22:56:08.000000000 +0900
@@ -111,7 +111,7 @@
 
   memset(&address, 0, sizeof(address));
   address.sin_family = AF_INET;
-  address.sin_len = sizeof(address);
+  /* address.sin_len = sizeof(address); */
   address.sin_port = htons(PORT);
   memcpy(&(address.sin_addr), host->h_addr, host->h_length);
 
