* Copyright (c) 1988 Regents of the University of California.
* Redistribution and use in source and binary forms are permitted
* provided that this notice is preserved and that due credit is given
* to the University of California at Berkeley. The name of the University
* may not be used to endorse or promote products derived from this
* software without specific prior written permission. This software
* is provided ``as is'' without express or implied warranty.
static char sccsid
[] = "@(#)system.c 3.2 (Berkeley) %G%";
#include "../general/general.h"
#include "../general/globals.h"
static char command
[256];
static int need_to_start
= 0;
* shell_continue() actually runs the command, and looks for API
* requests coming back in.
* We are called from the main loop in telnet.c.
* spint_start() returns when either the command has finished, or when
* the required interrupt comes in. In the latter case, the appropriate
* thing to do is to process the interrupt, and then return to
* the interrupt issuer by calling spint_continue().
spint_start(command
, &spinted
);
handle_api(&spinted
.regs
, &spinted
.sregs
);
spint_continue(&spinted
);
fprintf(stderr
, "Process generated a return code of 0x%x.\n",
printf("[Hit return to continue]");
(void) gets(inputbuffer
);
* Called from telnet.c to fork a lower command.com. We
* use the spint... routines so that we can pick up
* interrupts generated by application programs.
spinted
.int_no
= API_INTERRUPT_NUMBER
;
cmdptr
= command
+strlen(command
);
if ((cmdptr
+strlen(*argv
)) >= (command
+sizeof command
)) {
fprintf(stderr
, "Argument list too long at argument *%s*.\n",
*cmdptr
++ = ' '; /* Blank separators */
cmdptr
+= strlen(cmdptr
);
length
= strlen(command
)-1;
return 1; /* Go back to main loop */