Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
c3b7c67f
Commit
c3b7c67f
authored
Mar 21, 2003
by
Neal Norwitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for os.openpty() on AIX which uses /dev/ptc instead of /dev/ptmx.
parent
79b222e3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
Modules/posixmodule.c
Modules/posixmodule.c
+11
-3
No files found.
Modules/posixmodule.c
View file @
c3b7c67f
...
...
@@ -2572,6 +2572,14 @@ posix_fork(PyObject *self, PyObject *noargs)
}
#endif
/* AIX uses /dev/ptc but is otherwise the same as /dev/ptmx */
#ifdef HAVE_DEV_PTC
#define DEV_PTY_FILE "/dev/ptc"
#define HAVE_DEV_PTMX
#else
#define DEV_PTY_FILE "/dev/ptmx"
#endif
#if defined(HAVE_OPENPTY) || defined(HAVE_FORKPTY) || defined(HAVE_DEV_PTMX)
#ifdef HAVE_PTY_H
#include <pty.h>
...
...
@@ -2607,7 +2615,7 @@ posix_openpty(PyObject *self, PyObject *noargs)
#ifdef HAVE_OPENPTY
if
(
openpty
(
&
master_fd
,
&
slave_fd
,
NULL
,
NULL
,
NULL
)
!=
0
)
return
posix_error
();
#elif
HAVE__GETPTY
#elif
defined(HAVE__GETPTY)
slave_name
=
_getpty
(
&
master_fd
,
O_RDWR
,
0666
,
0
);
if
(
slave_name
==
NULL
)
return
posix_error
();
...
...
@@ -2616,7 +2624,7 @@ posix_openpty(PyObject *self, PyObject *noargs)
if
(
slave_fd
<
0
)
return
posix_error
();
#else
master_fd
=
open
(
"/dev/ptmx"
,
O_RDWR
|
O_NOCTTY
);
/* open master */
master_fd
=
open
(
DEV_PTY_FILE
,
O_RDWR
|
O_NOCTTY
);
/* open master */
if
(
master_fd
<
0
)
return
posix_error
();
sig_saved
=
signal
(
SIGCHLD
,
SIG_DFL
);
...
...
@@ -2637,7 +2645,7 @@ posix_openpty(PyObject *self, PyObject *noargs)
slave_fd
=
open
(
slave_name
,
O_RDWR
|
O_NOCTTY
);
/* open slave */
if
(
slave_fd
<
0
)
return
posix_error
();
#if
ndef __CYGWIN__
#if
!defined(__CYGWIN__) && !defined(HAVE_DEV_PTC)
ioctl
(
slave_fd
,
I_PUSH
,
"ptem"
);
/* push ptem */
ioctl
(
slave_fd
,
I_PUSH
,
"ldterm"
);
/* push ldterm */
#ifndef __hpux
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment