Skip to content
Merged
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Update the *length* parameter of :func:`os.pread` to accept
:c:type:`Py_ssize_t` instead of :c:type:`int`.
20 changes: 14 additions & 6 deletions Modules/clinic/posixmodule.c.h

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

7 changes: 3 additions & 4 deletions Modules/posixmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -8827,11 +8827,10 @@ os_readv_impl(PyObject *module, int fd, PyObject *buffers)

#ifdef HAVE_PREAD
/*[clinic input]
# TODO length should be size_t! but Python doesn't support parsing size_t yet.
os.pread

fd: int
length: int
length: Py_ssize_t
offset: Py_off_t
/

Expand All @@ -8842,8 +8841,8 @@ the beginning of the file. The file offset remains unchanged.
[clinic start generated code]*/

static PyObject *
os_pread_impl(PyObject *module, int fd, int length, Py_off_t offset)
/*[clinic end generated code: output=435b29ee32b54a78 input=084948dcbaa35d4c]*/
os_pread_impl(PyObject *module, int fd, Py_ssize_t length, Py_off_t offset)
/*[clinic end generated code: output=3f875c1eef82e32f input=85cb4a5589627144]*/
{
Py_ssize_t n;
int async_err = 0;
Expand Down