Implement writing to child process

This commit is contained in:
Kovid Goyal
2016-10-16 19:38:35 +05:30
parent 29ba13835a
commit f7eaf3fee5
4 changed files with 38 additions and 15 deletions
+1
View File
@@ -36,6 +36,7 @@ def create_pty():
if not hasattr(create_pty, 'master'):
create_pty.master, create_pty.slave = os.openpty()
fcntl.fcntl(create_pty.slave, fcntl.F_SETFD, fcntl.fcntl(create_pty.slave, fcntl.F_GETFD) & ~fcntl.FD_CLOEXEC)
# Note that master and slave are in blocking mode
return create_pty.master, create_pty.slave