Commit Graph

107 Commits

Author SHA1 Message Date
Miss Islington (bot) 69cf92fbca
[3.13] gh-116622: Don't expose `FICLONE` ioctl on Android (GH-122522) (#122539)
gh-116622: Don't expose `FICLONE` ioctl on Android (GH-122522)

Don't expose `FICLONE` ioctl on Android

(cherry picked from commit 06656e259b)

Co-authored-by: Malcolm Smith <smith@chaquo.com>
Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
2024-08-16 16:07:27 +08:00
Victor Stinner 4e147caf3f
[3.13] Revert "[3.13] gh-69214: Fix fcntl.ioctl() request type (GH-119498) (… (#119906)
Revert "[3.13] gh-69214: Fix fcntl.ioctl() request type (GH-119498) (#119504)"

This reverts commit 0bab0b3a53.

The change modified how negative values, like termios.TIOCSWINSZ, was
treated and is actually backward incompatible.
2024-06-01 17:08:23 +02:00
Miss Islington (bot) 0bab0b3a53
[3.13] gh-69214: Fix fcntl.ioctl() request type (GH-119498) (#119504)
gh-69214: Fix fcntl.ioctl() request type (GH-119498)

Use an 'unsigned long' instead of an 'unsigned int' for the request
parameter of fcntl.ioctl() to support requests larger than UINT_MAX.
(cherry picked from commit 92fab3356f)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-05-24 12:54:59 +00:00
Brett Simmers c2627d6eea
gh-116322: Add Py_mod_gil module slot (#116882)
This PR adds the ability to enable the GIL if it was disabled at
interpreter startup, and modifies the multi-phase module initialization
path to enable the GIL when loading a module, unless that module's spec
includes a slot indicating it can run safely without the GIL.

PEP 703 called the constant for the slot `Py_mod_gil_not_used`; I went
with `Py_MOD_GIL_NOT_USED` for consistency with gh-104148.

A warning will be issued up to once per interpreter for the first
GIL-using module that is loaded. If `-v` is given, a shorter message
will be printed to stderr every time a GIL-using module is loaded
(including the first one that issues a warning).
2024-05-03 11:30:55 -04:00
Victor Stinner 97b80af897
gh-85283: Build fcntl extension with the limited C API (#116791) 2024-03-14 12:01:13 +00:00
Serhiy Storchaka 1b719b39b9
gh-114321: Expose more constants in the fcntl module (GH-114322) 2024-01-22 18:09:22 +02:00
Serhiy Storchaka 2b15536fa9
gh-107913: Fix possible losses of OSError error codes (GH-107930)
Functions like PyErr_SetFromErrno() and SetFromWindowsErr() should be
called immediately after using the C API which sets errno or the Windows
error code.
2023-08-27 00:35:06 +03:00
Victor Stinner 6353c21b78
gh-106320: Remove private _PyLong_FileDescriptor_Converter() (#108503)
Move the private _PyLong converter functions to the internal C API

* _PyLong_FileDescriptor_Converter(): moved to pycore_fileutils.h
* _PyLong_Size_t_Converter(): moved to pycore_long.h

Argument Clinic now emits includes for pycore_fileutils.h and
pycore_long.h when these functions are used.
2023-08-26 03:18:09 +02:00
Inada Naoki d5bd32fb48
gh-104922: remove PY_SSIZE_T_CLEAN (#106315) 2023-07-02 15:07:46 +09:00
Eric Snow a9c6e0618f
gh-99113: Add Py_MOD_PER_INTERPRETER_GIL_SUPPORTED (gh-104205)
Here we are doing no more than adding the value for Py_mod_multiple_interpreters and using it for stdlib modules.  We will start checking for it in gh-104206 (once PyInterpreterState.ceval.own_gil is added in gh-104204).
2023-05-05 21:11:27 +00:00
Illia Volochii d1e2e0e1b2
gh-93475: Expose FICLONE and FICLONERANGE constants in fcntl (#93478) 2022-06-06 23:21:58 +02:00
David CARLIER 267539bff7
bpo-46016: fcntl module add FreeBSD's F_DUP2FD_CLOEXEC flag support (GH-29993) 2021-12-08 23:28:51 +01:00
Ruben Vorderman 23c0fb8edd
bpo-41586: Add pipesize parameter to subprocess & F_GETPIPE_SZ and F_SETPIPE_SZ to fcntl. (GH-21921)
* Add F_SETPIPE_SZ and F_GETPIPE_SZ to fcntl module
* Add pipesize parameter for subprocess.Popen class

This will allow the user to control the size of the pipes.
On linux the default is 64K. When a pipe is full it blocks for writing.
When a pipe is empty it blocks for reading. On processes that are
very fast this can lead to a lot of wasted CPU cycles. On a typical
Linux system the max pipe size is 1024K which is much better.
For high performance-oriented libraries such as xopen it is nice to
be able to set the pipe size.

The workaround without this feature is to use my_popen_process.stdout.fileno() in
conjuction with fcntl and 1031 (value of F_SETPIPE_SZ) to acquire this behavior.
2020-10-19 16:30:02 -07:00
Serhiy Storchaka 9975cc5008
bpo-41985: Add _PyLong_FileDescriptor_Converter and AC converter for "fildes". (GH-22620) 2020-10-09 23:00:45 +03:00
Dong-hee Na e9684fac5a
bpo-1635741: Port fcntl module to multiphase initialization (GH-20540) 2020-06-02 01:12:24 +09:00
Saiyang Gou 7514f4f625
bpo-39184: Add audit events to functions in `fcntl`, `msvcrt`, `os`, `resource`, `shutil`, `signal`, `syslog` (GH-18407) 2020-02-13 07:47:42 +00:00
Brandt Bucher 54b32c9871 bpo-38823: Clean up refleak in fcntl module initialization. (GH-17236) 2019-11-19 11:16:29 -08:00
Dong-hee Na 3bfc8e0fcc bpo-38602: Add fcntl.F_OFD_XXXX for fcntlmodule (GH-16956) 2019-10-28 09:31:15 +02:00
Vinay Sharma 13f37f2ba8 closes bpo-37964: add F_GETPATH command to fcntl (GH-15550)
https://bugs.python.org/issue37964



Automerge-Triggered-By: @benjaminp
2019-08-28 18:56:17 -07:00
Christian Heimes 8cbb5b6625
bpo-26835: Add file sealing constants to fcntl (GH-13694)
Co-authored-by: nanjekyejoannah <nanjekyejoannah@gmail.com>
2019-05-31 18:32:33 +02:00
nierob b409ffa848 bpo-35189: Retry fnctl calls on EINTR (GH-10413)
Modify the following fnctl function to retry if interrupted by a signal
(EINTR): flock, lockf, fnctl.
2018-11-23 16:46:12 +01:00
oldk aa0735f597 bpo-32747: Remove trailing spaces in docstrings. (GH-5491) 2018-02-02 10:52:55 +02:00
Serhiy Storchaka 55fe1ae970 bpo-30022: Get rid of using EnvironmentError and IOError (except test… (#1051) 2017-04-16 10:46:38 +03:00
Martin Panter 6d57fe1c23 Issue #28139: Fix messed up indentation
Also update the classmethod and staticmethod doc strings and comments to
match the RST documentation.
2016-09-17 03:26:16 +00:00
Serhiy Storchaka 1a2b24f02d Issue #27332: Fixed the type of the first argument of module-level functions
generated by Argument Clinic.  Patch by Petr Viktorin.
2016-07-07 17:35:15 +03:00
Serhiy Storchaka d6117a4296 Issue #26716: Regenerate Argument Clinic code. 2016-04-14 12:28:01 +03:00
Victor Stinner d0d5154251 Update fcntl doc: replace IOError with OSError
Issue #26716. IOError is a deprecated alias to OSError since Python 3.3.
2016-04-09 11:32:58 +02:00
Larry Hastings 89964c48d1 Issue #23944: Argument Clinic now wraps long impl prototypes at column 78. 2015-04-14 18:07:59 -04:00
Serhiy Storchaka 1009bf18b3 Issue #23501: Argumen Clinic now generates code into separate files by default. 2015-04-03 23:53:51 +03:00
Serhiy Storchaka 17d3a58e39 Issue #22832: Tweaked parameter names for fcntl module to better match
official POSIX documentation.  Updated the documenttion for Python 3.
Patch by Alex Shkop.
2015-03-20 20:04:21 +02:00
Serhiy Storchaka 483405bcca Issue #22883: Got rid of outdated references to PyInt and PyString in comments. 2015-02-17 10:14:30 +02:00
Serhiy Storchaka 5a8dacf9c6 Issue #22821: Fixed fcntl() with integer argument on 64-bit big-endian
platforms.
2014-11-10 11:25:50 +02:00
Serhiy Storchaka d915b0847d Issue #22821: Fixed fcntl() with integer argument on 64-bit big-endian
platforms.
2014-11-10 10:42:26 +02:00
Brett Cannon b7299ddbc7 Issue 20152, 22821: Port the fcntl module to Argument Clinic.
Along the way, fix an argumrnt to fcntl.fcntl to be an int instead of
a long.

Thanks to Serhiy Storchaka for reviewing my Clinic patch and for
writing the patch to fix the long/int issue.
2014-11-09 20:22:01 -05:00
Victor Stinner 049e509a9f Issue #22207: Fix "comparison between signed and unsigned integers" warning in
test checking for integer overflow on Py_ssize_t type: cast explicitly to
size_t.
2014-08-17 22:20:00 +02:00
Christian Heimes af01f66817 Issue #16136: Remove VMS support and VMS-related code 2013-12-21 16:19:10 +01:00
Charles-François Natali 5abca14b00 Issue #18994: Add a missing check for a return value in fcntmodule. Patch by
Vajrasky Kok.
2013-12-01 14:30:47 +01:00
R David Murray 589327ea7a Merge #18985: Improve fcntl documentation. 2013-11-07 10:51:41 -05:00
R David Murray d5a2f0b3a1 #18985: Improve fcntl documentation.
Original patch by Vajrasky Kok, further improved (I hope) by me.
2013-11-07 10:51:07 -05:00
Ned Deily f55697ca6d Issue #19147: merge from 3.3 2013-10-02 12:22:05 -07:00
Ned Deily 2a8b3f26b9 Issue #19147: Fix docstring for fcntl.flock to refer to correct man section. 2013-10-02 12:20:46 -07:00
Charles-Francois Natali 74ca886788 Issue #17917: Use PyModule_AddIntMacro() instead of PyModule_AddIntConstant()
when applicable.
2013-05-20 19:13:19 +02:00
Victor Stinner 2716d531a1 fcntl: add F_DUPFD_CLOEXEC constant, available on Linux 2.6.24+. 2013-01-08 00:52:40 +01:00
Jesus Cea 14c81aba50 #16135: Removal of OS/2 support (Modules/*) 2012-10-05 02:11:36 +02:00
Charles-François Natali 23e1ecbd66 Issue #13324: fcntlmodule: Add the F_NOCACHE flag. Patch by Alex Stewart. 2011-11-02 18:58:25 +01:00
Antoine Pitrou 5e38aae91b Issue #9758: When fcntl.ioctl() was called with mutable_flag set to True,
and the passed buffer was exactly 1024 bytes long, the buffer wouldn't
be updated back after the system call.  Original patch by Brian Brazil.
2010-09-07 16:30:09 +00:00
Georg Brandl 1f94cd0c7a #9776: fix some spacing. 2010-09-05 17:09:18 +00:00
Antoine Pitrou f95a1b3c53 Recorded merge of revisions 81029 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines

  Untabify C files. Will watch buildbots.
........
2010-05-09 15:52:27 +00:00
Antoine Pitrou 61f77b57fd Merged revisions 72887 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r72887 | antoine.pitrou | 2009-05-24 17:40:09 +0200 (dim., 24 mai 2009) | 6 lines

  Issue #1309352: fcntl now converts its third arguments to a C `long` rather
  than an int, which makes some operations possible under 64-bit Linux (e.g.
  DN_MULTISHOT with F_NOTIFY).
........
2009-05-24 15:46:13 +00:00
Martin v. Löwis 423be95dcf Merged revisions 65654 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r65654 | martin.v.loewis | 2008-08-12 16:49:50 +0200 (Tue, 12 Aug 2008) | 6 lines

  Issue #3139: Make buffer-interface thread-safe wrt. PyArg_ParseTuple,
  by denying s# to parse objects that have a releasebuffer procedure,
  and introducing s*.

  More module might need to get converted to use s*.
........
2008-08-13 15:53:07 +00:00