mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
gh-138779: Use the dev_t converter for st_rdev (GH-138780)
This allows to support device numbers larger than 2**63-1.
This commit is contained in:
parent
32b2c5de16
commit
43013f72f0
2 changed files with 4 additions and 1 deletions
|
|
@ -0,0 +1,3 @@
|
||||||
|
Support device numbers larger than ``2**63-1`` for the
|
||||||
|
:attr:`~os.stat_result.st_rdev` field of the :class:`os.stat_result`
|
||||||
|
structure.
|
||||||
|
|
@ -2759,7 +2759,7 @@ _pystat_fromstructstat(PyObject *module, STRUCT_STAT *st)
|
||||||
SET_ITEM(ST_BLOCKS_IDX, PyLong_FromLong((long)st->st_blocks));
|
SET_ITEM(ST_BLOCKS_IDX, PyLong_FromLong((long)st->st_blocks));
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_STRUCT_STAT_ST_RDEV
|
#ifdef HAVE_STRUCT_STAT_ST_RDEV
|
||||||
SET_ITEM(ST_RDEV_IDX, PyLong_FromLong((long)st->st_rdev));
|
SET_ITEM(ST_RDEV_IDX, _PyLong_FromDev(st->st_rdev));
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_STRUCT_STAT_ST_GEN
|
#ifdef HAVE_STRUCT_STAT_ST_GEN
|
||||||
SET_ITEM(ST_GEN_IDX, PyLong_FromLong((long)st->st_gen));
|
SET_ITEM(ST_GEN_IDX, PyLong_FromLong((long)st->st_gen));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue