/external/python/cpython3/Lib/ |
D | pty.py | 30 slave_fd = slave_open(slave_name) 31 return master_fd, slave_fd 39 master_fd, slave_fd = os.openpty() 43 slave_name = os.ttyname(slave_fd) 44 os.close(slave_fd) 96 master_fd, slave_fd = openpty() 104 os.dup2(slave_fd, STDIN_FILENO) 105 os.dup2(slave_fd, STDOUT_FILENO) 106 os.dup2(slave_fd, STDERR_FILENO) 107 if (slave_fd > STDERR_FILENO): [all …]
|
/external/python/cpython2/Lib/ |
D | pty.py | 30 slave_fd = slave_open(slave_name) 31 return master_fd, slave_fd 39 master_fd, slave_fd = os.openpty() 43 slave_name = os.ttyname(slave_fd) 44 os.close(slave_fd) 107 master_fd, slave_fd = openpty() 115 os.dup2(slave_fd, STDIN_FILENO) 116 os.dup2(slave_fd, STDOUT_FILENO) 117 os.dup2(slave_fd, STDERR_FILENO) 118 if (slave_fd > STDERR_FILENO): [all …]
|
/external/ltp/testcases/cve/ |
D | cve-2014-0196.c | 53 static volatile int master_fd, slave_fd; variable 85 SAFE_WRITE(0, slave_fd, buf, BUFLEN - 1); in overwrite_thread_fn() 86 SAFE_WRITE(0, slave_fd, buf, BUFLEN - 1); in overwrite_thread_fn() 87 SAFE_WRITE(0, slave_fd, buf, BUFLEN); in overwrite_thread_fn() 102 create_pty((int *)&master_fd, (int *)&slave_fd); in run() 110 SAFE_WRITE(0, slave_fd, buf, 1); in run() 132 ioctl(slave_fd, 0xdeadbeef); in run() 134 SAFE_CLOSE(slave_fd); in run() 149 close(slave_fd); in cleanup()
|
/external/python/cpython3/Lib/test/ |
D | test_pty.py | 86 slave_fd = pty.slave_open(slave_name) 87 debug("Got slave_fd '%d'" % slave_fd) 92 self.assertTrue(os.isatty(slave_fd), 'slave_fd is not a tty') 113 os.write(slave_fd, TEST_STRING_1) 119 os.write(slave_fd, TEST_STRING_2[:5]) 120 os.write(slave_fd, TEST_STRING_2[5:]) 124 os.close(slave_fd)
|
D | test_os.py | 3262 master_fd, slave_fd = os.openpty() 3264 self.addCleanup(os.close, slave_fd) 3266 self.assertEqual(os.get_inheritable(slave_fd), False)
|
/external/python/cpython2/Lib/test/ |
D | test_pty.py | 88 slave_fd = pty.slave_open(slave_name) 89 debug("Got slave_fd '%d'" % slave_fd) 94 self.assertTrue(os.isatty(slave_fd), 'slave_fd is not a tty') 113 os.write(slave_fd, TEST_STRING_1) 119 os.write(slave_fd, TEST_STRING_2[:5]) 120 os.write(slave_fd, TEST_STRING_2[5:]) 124 os.close(slave_fd)
|
/external/ppp/pppd/ |
D | sys-linux.c | 180 static int slave_fd = -1; /* pty for old-style demand mode, slave */ variable 278 if (!hungup || ppp_fd == slave_fd) in still_ppp() 280 if (slave_fd >= 0) { in still_ppp() 281 set_ppp_fd(slave_fd); in still_ppp() 375 if (slave_fd >= 0) in sys_close() 376 close(slave_fd); in sys_close() 418 && ioctl(slave_fd, PPPIOCXFERUNIT, 0) < 0) { in tty_establish_ppp() 613 set_ppp_fd(slave_fd); in generic_disestablish_ppp() 2703 if (!get_pty(&master_fd, &slave_fd, loop_name, 0)) in open_ppp_loopback() 2706 set_ppp_fd(slave_fd); in open_ppp_loopback()
|
/external/python/cpython3/Modules/ |
D | posixmodule.c | 5939 int master_fd = -1, slave_fd = -1; in os_openpty_impl() local 5951 if (openpty(&master_fd, &slave_fd, NULL, NULL, NULL) != 0) in os_openpty_impl() 5956 if (_Py_set_inheritable(slave_fd, 0, NULL) < 0) in os_openpty_impl() 5966 slave_fd = _Py_open(slave_name, O_RDWR); in os_openpty_impl() 5967 if (slave_fd < 0) in os_openpty_impl() 5995 slave_fd = _Py_open(slave_name, O_RDWR | O_NOCTTY); /* open slave */ in os_openpty_impl() 5996 if (slave_fd == -1) in os_openpty_impl() 6003 ioctl(slave_fd, I_PUSH, "ptem"); /* push ptem */ in os_openpty_impl() 6004 ioctl(slave_fd, I_PUSH, "ldterm"); /* push ldterm */ in os_openpty_impl() 6006 ioctl(slave_fd, I_PUSH, "ttcompat"); /* push ttcompat */ in os_openpty_impl() [all …]
|
/external/python/cpython2/Modules/ |
D | posixmodule.c | 3950 int master_fd, slave_fd; in posix_openpty() local 3962 if (openpty(&master_fd, &slave_fd, NULL, NULL, NULL) != 0) in posix_openpty() 3969 slave_fd = open(slave_name, O_RDWR); in posix_openpty() 3970 if (slave_fd < 0) in posix_openpty() 3991 slave_fd = open(slave_name, O_RDWR | O_NOCTTY); /* open slave */ in posix_openpty() 3992 if (slave_fd < 0) in posix_openpty() 3995 ioctl(slave_fd, I_PUSH, "ptem"); /* push ptem */ in posix_openpty() 3996 ioctl(slave_fd, I_PUSH, "ldterm"); /* push ldterm */ in posix_openpty() 3998 ioctl(slave_fd, I_PUSH, "ttcompat"); /* push ttcompat */ in posix_openpty() 4003 return Py_BuildValue("(ii)", master_fd, slave_fd); in posix_openpty()
|