Lines Matching refs:ttyfd
116 static int ttyfd = -1; variable
155 if (ttyfd >= 0) { in jobctl_notty()
156 close(ttyfd); in jobctl_notty()
157 ttyfd = -1; in jobctl_notty()
178 if (ttyfd != -1) in setjobctl()
179 close(ttyfd); in setjobctl()
180 if ((ttyfd = open(_PATH_TTY, O_RDWR | O_CLOEXEC)) < 0) { in setjobctl()
185 (ttyfd = fcntl(i, F_DUPFD_CLOEXEC, 10)) < 0) { in setjobctl()
190 if (ttyfd < 10) { in setjobctl()
195 if ((i = fcntl(ttyfd, F_DUPFD_CLOEXEC, 10)) < 0) { in setjobctl()
199 close(ttyfd); in setjobctl()
200 ttyfd = i; in setjobctl()
203 initialpgrp = tcgetpgrp(ttyfd); in setjobctl()
222 tcsetpgrp(ttyfd, rootpid); in setjobctl()
225 if (ttyfd >= 0) { in setjobctl()
226 tcsetpgrp(ttyfd, initialpgrp); in setjobctl()
227 close(ttyfd); in setjobctl()
228 ttyfd = -1; in setjobctl()
254 if (ttyfd >= 0) in fgcmd()
255 tcsetpgrp(ttyfd, pgrp); in fgcmd()
924 ttyfd >= 0) { in forkshell()
931 if (tcsetpgrp(ttyfd, pgrp) < 0) in forkshell()
1091 if (ttyfd >= 0 && tcsetpgrp(ttyfd, rootpid) < 0) in waitforjob()