/external/python/cpython3/Lib/ |
D | pty.py | 31 slave_fd = slave_open(slave_name) 32 return master_fd, slave_fd 40 master_fd, slave_fd = os.openpty() 44 slave_name = os.ttyname(slave_fd) 45 os.close(slave_fd) 97 master_fd, slave_fd = openpty() 105 os.dup2(slave_fd, STDIN_FILENO) 106 os.dup2(slave_fd, STDOUT_FILENO) 107 os.dup2(slave_fd, STDERR_FILENO) 108 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 | 41 static volatile int master_fd, slave_fd; variable 73 SAFE_WRITE(0, slave_fd, buf, BUFLEN - 1); in overwrite_thread_fn() 74 SAFE_WRITE(0, slave_fd, buf, BUFLEN - 1); in overwrite_thread_fn() 75 SAFE_WRITE(0, slave_fd, buf, BUFLEN); in overwrite_thread_fn() 90 create_pty((int *)&master_fd, (int *)&slave_fd); in run() 98 SAFE_WRITE(0, slave_fd, buf, 1); in run() 120 ioctl(slave_fd, 0xdeadbeef); in run() 122 SAFE_CLOSE(slave_fd); in run() 137 close(slave_fd); in cleanup()
|
/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/python/cpython3/Lib/test/ |
D | test_pty.py | 97 slave_fd = pty.slave_open(slave_name) 98 debug("Got slave_fd '%d'" % slave_fd) 103 self.assertTrue(os.isatty(slave_fd), 'slave_fd is not a tty') 124 os.write(slave_fd, TEST_STRING_1) 130 os.write(slave_fd, TEST_STRING_2[:5]) 131 os.write(slave_fd, TEST_STRING_2[5:]) 135 os.close(slave_fd)
|
D | test_os.py | 3716 master_fd, slave_fd = os.openpty() 3718 self.addCleanup(os.close, slave_fd) 3720 self.assertEqual(os.get_inheritable(slave_fd), False)
|
/external/llvm-project/compiler-rt/lib/sanitizer_common/ |
D | sanitizer_mac.cpp | 256 fd_t slave_fd = kInvalidFd; in internal_spawn_impl() local 260 internal_close(slave_fd); in internal_spawn_impl() 277 slave_fd = internal_open(slave_pty_name, O_RDWR); in internal_spawn_impl() 278 if (slave_fd == kInvalidFd) return kInvalidFd; in internal_spawn_impl() 289 res = posix_spawn_file_actions_adddup2(&acts, slave_fd, STDIN_FILENO) || in internal_spawn_impl() 290 posix_spawn_file_actions_adddup2(&acts, slave_fd, STDOUT_FILENO) || in internal_spawn_impl() 291 posix_spawn_file_actions_addclose(&acts, slave_fd); in internal_spawn_impl()
|
/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/rust/crates/nix/test/ |
D | test_pty.rs | 114 let slave_fd = open(Path::new(&slave_name), OFlag::O_RDWR, stat::Mode::empty()).unwrap(); in open_ptty_pair() localVariable 115 let slave = unsafe { File::from_raw_fd(slave_fd) }; in open_ptty_pair()
|
/external/python/cpython3/Modules/ |
D | posixmodule.c | 7101 int master_fd = -1, slave_fd = -1; in os_openpty_impl() local 7113 if (openpty(&master_fd, &slave_fd, NULL, NULL, NULL) != 0) in os_openpty_impl() 7118 if (_Py_set_inheritable(slave_fd, 0, NULL) < 0) in os_openpty_impl() 7128 slave_fd = _Py_open(slave_name, O_RDWR); in os_openpty_impl() 7129 if (slave_fd < 0) in os_openpty_impl() 7157 slave_fd = _Py_open(slave_name, O_RDWR | O_NOCTTY); /* open slave */ in os_openpty_impl() 7158 if (slave_fd == -1) in os_openpty_impl() 7165 ioctl(slave_fd, I_PUSH, "ptem"); /* push ptem */ in os_openpty_impl() 7166 ioctl(slave_fd, I_PUSH, "ldterm"); /* push ldterm */ in os_openpty_impl() 7168 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()
|