* Check for possible program to run under alternate runtime system
* If it checks out, start the rts and pass file and args
compat(file
, argv
, envp
) char *file
, *argv
[], *envp
[]; {
/* alternate rts images must be readable */
/* if not just go back and let rest of shell worry about it */
if((fd
= open(file
,0))<0)
/* read first BS pdp-11 words */
if(read(fd
,buf
,sizeof buf
) != sizeof buf
) {
/* if can't, go back as it may be a short shell file */
/* check type of image and set up run time system name */
if(buf
[0]==0407 || buf
[0]==0410 || buf
[0]==0411 || buf
[0]==0405) {
/* looks like UNIX a.out file */
if((rts
= rtsnod
.namval
) == 0)
/* if header unused is set to 1 force version 6 */
/* this is not a real difference between v6 and v7 a.outs */
/* rather, version 6 a.outs were patched to be identifiable */
/* it looks like almost all RT-11 save images have 0 here */
/* was not a recognizable file type */
/* must make a new argv list with runtime system prefix */
/* have to pass full file name to rts */
while(*argv
&& nargv
< &nargs
[MAXARGS
-1])
/* force in final null */
execve(nargs
[0], nargs
, envp
);
/* if that failed, report no runtime system */