Thanks to visit codestin.com
Credit goes to github.com

Skip to content

gh-114727: Update os_{openpty|grantpt}_impl to use per module lock. #117017

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions Modules/clinic/posixmodule.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions Modules/posixmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -8419,6 +8419,7 @@ os_posix_openpt_impl(PyObject *module, int oflag)

#ifdef HAVE_GRANTPT
/*[clinic input]
@critical_section
os.grantpt

fd: fildes
Expand All @@ -8432,7 +8433,7 @@ Performs a grantpt() C function call.

static PyObject *
os_grantpt_impl(PyObject *module, int fd)
/*[clinic end generated code: output=dfd580015cf548ab input=0668e3b96760e849]*/
/*[clinic end generated code: output=dfd580015cf548ab input=c813b58c0ee7d9a0]*/
{
int ret;
int saved_errno;
Expand Down Expand Up @@ -8547,6 +8548,7 @@ os_ptsname_impl(PyObject *module, int fd)

#if defined(HAVE_OPENPTY) || defined(HAVE__GETPTY) || defined(HAVE_DEV_PTMX)
/*[clinic input]
@critical_section
os.openpty

Open a pseudo-terminal.
Expand All @@ -8557,7 +8559,7 @@ for both the master and slave ends.

static PyObject *
os_openpty_impl(PyObject *module)
/*[clinic end generated code: output=98841ce5ec9cef3c input=f3d99fd99e762907]*/
/*[clinic end generated code: output=98841ce5ec9cef3c input=49472bedd2dfaffe]*/
{
int master_fd = -1, slave_fd = -1;
#ifndef HAVE_OPENPTY
Expand Down