Lines Matching defs:slave
174 char *slave=0;
181 slave = ptsname(*master);
192 slave = ptsname(fdm);
194 slave = slavename(name);
201 return(slave);
207 mkpty(int* master, int* slave)
242 if (openpty(master, slave, NULL, ttyp, winp) < 0)
254 if (grantpt(*master) || unlockpt(*master) || !(sname = ptsname(*master)) || (*slave = open(sname, O_RDWR|O_cloexec)) < 0)
260 if (!(sname = ptymopen(master)) || (*slave = open(sname, O_RDWR|O_cloexec)) < 0)
264 if (tcgetattr(*slave, &tst) < 0 && (ioctl(*slave, I_PUSH, "ptem") < 0 || ioctl(*slave, I_PUSH, "ldterm") < 0))
266 close(*slave);
272 if (ttyp && tcsetattr(*slave, TCSANOW, ttyp) < 0)
275 if (winp && ioctl(*slave, TIOCSWINSZ, winp) < 0)
280 fcntl(*slave, F_SETFD, FD_CLOEXEC);
287 runcmd(char** argv, int slave, int session)
293 ops[0] = PROC_FD_CTTY(slave);
298 ops[0] = PROC_FD_DUP(slave, 0, PROC_FD_CHILD);
299 ops[1] = PROC_FD_DUP(slave, 1, PROC_FD_CHILD);
300 ops[2] = PROC_FD_DUP(slave, 2, PROC_FD_CHILD);
954 int slave;
1013 if (mkpty(&master, &slave) < 0)
1030 sfsprintf(ap->argv[1] = buf, sizeof(buf), "--fd=%d", slave);
1045 if (!(proc = runcmd(argv, slave, session)))
1047 close(slave);
1064 slave = (*fun)(mp, lp, delay, timeout);
1068 return slave ? slave : master;