Lines Matching defs:slave
63 static int findpty(char **slave)
76 *slave = (char *)ptsname(master);
77 if (*slave == NULL)
80 ("findpty: Unable to create master/slave pty pair.\n"));
88 ("findpty: Allocated slave pty %s\n", *slave));
112 *slave = line;
125 int slave;
150 /* Open slave pty and acquire as new controlling terminal. */
151 if ((slave = sys_open(slavedev, O_RDWR, 0)) < 0)
157 if (ioctl(slave, I_FIND, "ptem") == 0) {
158 ioctl(slave, I_PUSH, "ptem");
160 if (ioctl(slave, I_FIND, "ldterm") == 0) {
161 ioctl(slave, I_PUSH, "ldterm");
164 if (ioctl(slave, TIOCSCTTY, 0) < 0)
166 DEBUG(3, ("Error in ioctl call for slave pty\n"));
174 /* Make slave stdin/out/err of child. */
176 if (sys_dup2(slave, STDIN_FILENO) != STDIN_FILENO)
181 if (sys_dup2(slave, STDOUT_FILENO) != STDOUT_FILENO)
186 if (sys_dup2(slave, STDERR_FILENO) != STDERR_FILENO)
191 if (slave > 2)
192 close(slave);