9 sys(char *buf, int devnull)
15 notedisable("sys: child");
17 nf = tokenize(buf2, f, nelem(f));
22 open("/dev/null", OREAD);
24 open("/dev/null", OREAD);
33 rcstart(int argc, char **argv, int *pfd, int *tfd)
43 argv[0] = getenv("SHELL");
51 argv[0] = malloc(strlen(cmd)+2);
52 strcpy(argv[0]+1, cmd);
57 * fd0 is slave (tty), fd1 is master (pty)
60 if(getpts(fd, slave) < 0){
62 sysfatal("getpts: %r\n");
65 * notedisable("sys: window size change");
67 * Can't disable because will be inherited by other programs
68 * like if you run an xterm from the prompt, and then xterm's
69 * resizes won't get handled right. Sigh.
71 * Can't not disable because when we stty below we'll get a
72 * signal, which will drop us into the thread library note handler,
73 * which will get all confused because we just forked and thus
74 * have an unknown pid.
76 * So disable it internally. ARGH!
78 notifyoff("sys: window size change");
83 putenv("TERM", "9term");
84 sfd = childpty(fd, slave);
88 sys("stty tabs -onlcr icanon echo erase '^h' intr '^?'", 0);
89 sys("stty onocr", 1); /* not available on mac */
94 signal(SIGINT, SIG_DFL);
95 signal(SIGHUP, SIG_DFL);
96 signal(SIGTERM, SIG_DFL);
98 fprint(2, "exec %s failed: %r\n", argv[0]);
102 sysfatal("proc failed: %r");
108 if((*tfd = open(slave, OREAD)) < 0)
109 sysfatal("parent open %s: %r", slave);