diff -Naur -X exclude-files ac_cur/arch/um/drivers/mcast_user.c ac/arch/um/drivers/mcast_user.c --- ac_cur/arch/um/drivers/mcast_user.c Sat Aug 4 15:57:57 2001 +++ ac/arch/um/drivers/mcast_user.c Sat Aug 4 21:00:57 2001 @@ -13,6 +13,7 @@ #include #include +#include #include #include #include diff -Naur -X exclude-files ac_cur/arch/um/drivers/mconsole_kern.c ac/arch/um/drivers/mconsole_kern.c --- ac_cur/arch/um/drivers/mconsole_kern.c Sat Aug 4 16:09:26 2001 +++ ac/arch/um/drivers/mconsole_kern.c Sat Aug 4 21:00:57 2001 @@ -87,6 +87,22 @@ mconsole_reply(req, version); } +#define UML_MCONSOLE_HELPTEXT "OK +Commands: + version - Get kernel version + help - Print this message + halt - Halt UML + reboot - Reboot UML + config = - Add a new device to UML; + same syntax as command line + remove - Remove a device from the client +" + +void mconsole_help(struct mconsole_request *req) +{ + mconsole_reply(req, UML_MCONSOLE_HELPTEXT) ; +} + void mconsole_halt(struct mconsole_request *req) { mconsole_reply(req, "OK"); diff -Naur -X exclude-files ac_cur/arch/um/drivers/mconsole_user.c ac/arch/um/drivers/mconsole_user.c --- ac_cur/arch/um/drivers/mconsole_user.c Sat Aug 4 15:57:57 2001 +++ ac/arch/um/drivers/mconsole_user.c Sat Aug 4 21:00:57 2001 @@ -12,7 +12,9 @@ #include #include #include +#include "user.h" #include "mconsole.h" +#include "umid.h" static struct mconsole_command commands[] = { { "version", mconsole_version }, @@ -20,9 +22,10 @@ { "reboot", mconsole_reboot }, { "config", mconsole_config }, { "remove", mconsole_remove }, + { "help", mconsole_help }, }; -char socket_name[128]; +char socket_name[256]; static int has_correct_credentials(struct msghdr *msg) { @@ -103,36 +106,30 @@ int create_listening_socket(void) { struct sockaddr_un addr; - int sock; - int yes = 1; + char file[256]; + int sock, err, yes = 1; sock = socket(PF_UNIX, SOCK_DGRAM, 0); if (sock < 0) { - perror("socket"); - return -1; + printk("create_listening_socket - socket failed, errno = %d\n", + errno); + return(-1); } addr.sun_family = AF_UNIX; - while (1) { - int err; - char *temp; - - temp = tempnam("/tmp", "uml"); - if (temp == NULL) - return -1; - - strcpy(socket_name, temp); - strcpy(addr.sun_path, temp); - - err = bind(sock, (struct sockaddr *) &addr, sizeof(addr)); - if (err < 0) { - if (errno != EADDRINUSE) { - perror("bind"); - return -1; - } - } else - break; + if(umid_file_name("mconsole", file, sizeof(file))) return(-1); + + strcpy(socket_name, file); + strcpy(addr.sun_path, file); + + err = bind(sock, (struct sockaddr *) &addr, sizeof(addr)); + if (err < 0) { + if (errno != EADDRINUSE) { + printk("create_listening_socket - bind failed, " + "errno = %d\n", errno); + return(-1); + } } setsockopt(sock, SOL_SOCKET, SO_PASSCRED, &yes, sizeof(yes)); diff -Naur -X exclude-files ac_cur/arch/um/include/mconsole.h ac/arch/um/include/mconsole.h --- ac_cur/arch/um/include/mconsole.h Sat Aug 4 15:57:57 2001 +++ ac/arch/um/include/mconsole.h Sat Aug 4 21:00:57 2001 @@ -28,6 +28,7 @@ extern int unlink_socket(void); extern int mconsole_reply(struct mconsole_request *req, char *reply); extern void mconsole_version(struct mconsole_request *req); +extern void mconsole_help(struct mconsole_request *req); extern void mconsole_halt(struct mconsole_request *req); extern void mconsole_reboot(struct mconsole_request *req); extern void mconsole_config(struct mconsole_request *req); diff -Naur -X exclude-files ac_cur/arch/um/kernel/trap_kern.c ac/arch/um/kernel/trap_kern.c --- ac_cur/arch/um/kernel/trap_kern.c Sat Aug 4 15:57:57 2001 +++ ac/arch/um/kernel/trap_kern.c Sat Aug 4 21:00:57 2001 @@ -162,7 +162,11 @@ "errno = %d\n", errno); gdb_pid = -1; } - else ptrace(PTRACE_KILL, debugger_pid, 0, 0); + else { + kill(debugger_pid, SIGKILL); + kill(debugger_pid, SIGCONT); + while(waitpid(debugger_pid, NULL, WNOHANG) > 0) ; + } debugger_pid = -1; } close_chan_pair(&gdb_chan); diff -Naur -X exclude-files ac_cur/arch/um/sys-i386/ldt.c ac/arch/um/sys-i386/ldt.c --- ac_cur/arch/um/sys-i386/ldt.c Sat Aug 4 15:57:57 2001 +++ ac/arch/um/sys-i386/ldt.c Sat Aug 4 21:00:57 2001 @@ -3,6 +3,8 @@ * Licensed under the GPL */ +extern int modify_ldt(int func, void *ptr, unsigned long bytecount); + int sys_modify_ldt(int func, void *ptr, unsigned long bytecount) { return modify_ldt(func, ptr, bytecount);