1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-02-01 06:12:31 +00:00

Remove OCR code. (#195)

This is very dated code that assumes there's a `/dev/ocr0`.

I'm not sure what system this was for, but it doesn't appear to
be one that exists currently.

Discussed in interlisp/medley#126.
This commit is contained in:
Bruce Mitchener
2021-01-09 12:20:18 +07:00
committed by GitHub
parent 2dcdf14334
commit f3b52564e4
5 changed files with 0 additions and 2694 deletions

View File

@@ -162,8 +162,6 @@ int ForkUnixShell(int slot, char *PtySlave, char *termtype, char *shellarg)
K: Kill process
E: Exit (kill all subprocesses)
C: Close stdin to subprocess
W: call WAIT3 & get one process's close info.
O: Fork OCR process.
Byte 1: Process number (0 to NPROCS - 1)
Not used for S, F, and E commands
[For S&P, pty letter]
@@ -193,9 +191,6 @@ of the packet received except:
Byte 3 is 1 if an exit status was available.
E: Always the same
C: Always the same
O: Byte 3 is 1 if successful, 0 if not
Byte 1 and Byte 2 are the process ID of OCR process
*/
int fork_Unix() {
@@ -403,10 +398,6 @@ int fork_Unix() {
{
int status;
#ifdef OCR
int slot;
#endif
status = 0;
IOBuf[0] = 0;
@@ -432,73 +423,6 @@ int fork_Unix() {
case 'C': /* Close stdin to subprocess */ break;
case 'K': /* Kill subprocess */ break;
#ifdef OCR
case 'w': /* Wait paticular process to die */
{
int pid, res, status;
pid = IOBuf[1] << 8 | IOBuf[2];
retry:
res = waitpid(pid, &status, WNOHANG);
if (res == -1 && errno == EINTR) goto retry;
if (res == pid) {
IOBuf[0] = res >> 24 & 0xFF;
IOBuf[1] = res >> 16 & 0xFF;
IOBuf[2] = res >> 8 & 0xFF;
IOBuf[3] = res & 0xFF;
} else {
IOBuf[0] = IOBuf[1] = IOBuf[2] = IOBuf[3] = 0;
}
} break;
case 'O': /* Fork OCR process */
if (slot >= 0) {
pid_t ppid;
ppid = getppid();
pid = fork();
if (pid == 0) {
int i;
int status, len;
struct sockaddr_un addr;
char PipeName[40];
extern int OCR_sv;
OCR_sv = socket(AF_UNIX, SOCK_STREAM, 0);
if (OCR_sv < 0) {
perror("slave socket");
exit(0);
}
sprintf(PipeName, "/tmp/LispPipe%d-%d", StartTime, slot);
addr.sun_family = AF_UNIX;
strcpy(addr.sun_path, PipeName);
len = strlen(PipeName) + sizeof(addr.sun_family);
status = connect(OCR_sv, &addr, len);
if (status < 0) {
perror("OCR slave connect");
OCR_sv = -1;
exit(0);
}
(void)ocr_proc(ppid);
OCR_sv = -1;
exit(1);
}
if (pid == -1) {
perror("unixcomm: fork OCR");
IOBuf[3] = 0;
} else {
IOBuf[1] = (pid >> 8) & 0xFF;
IOBuf[2] = pid & 0xFF;
}
} else
IOBuf[3] = 0;
break;
#endif /* OCR */
} /* End of switch */
/* Return the status/data packet */