Author haypo
Recipients eryksun, haypo, mba, serhiy.storchaka, steve.dower, xdegaye, xiang.zhang
Date 2017-05-17.18:48:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1495046930.69.0.173220220963.issue29619@psf.upfronthosting.co.za>
In-reply-to
Content
Before 0f6d73343d342c106cda2219ebb8a6f0c4bd9b3c, the code used PyLong_FromLong((long)st->st_ino), so the change doesn't introduce a regression but detected a real bug, right?

> On Android architecture 'x86' at api level 21:
>    sizeof(st->st_ino) = 8
> and from the output of configure:
>    checking size of off_t... 4
>    checking size of long... 4
>    checking size of long long... 8

What is the type of st_ino? It's not off_t?

A workaround would be to force the usage unsigned long long on Android, right?

Can you please try the following patch on Android, and propose a PR if it works?

diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index e8c15a9..78b3cb9 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -1927,7 +1927,7 @@ _pystat_fromstructstat(STRUCT_STAT *st)
         return NULL;
 
     PyStructSequence_SET_ITEM(v, 0, PyLong_FromLong((long)st->st_mode));
-#if defined(HAVE_LARGEFILE_SUPPORT) || defined(MS_WINDOWS)
+#if defined(HAVE_LARGEFILE_SUPPORT) || defined(MS_WINDOWS) || defined(defined(__ANDROID__))
     Py_BUILD_ASSERT(sizeof(unsigned long long) >= sizeof(st->st_ino));
     PyStructSequence_SET_ITEM(v, 1,
                               PyLong_FromUnsignedLongLong(st->st_ino));
History
Date User Action Args
2017-05-17 18:48:50hayposetrecipients: + haypo, xdegaye, serhiy.storchaka, eryksun, steve.dower, xiang.zhang, mba
2017-05-17 18:48:50hayposetmessageid: <1495046930.69.0.173220220963.issue29619@psf.upfronthosting.co.za>
2017-05-17 18:48:50haypolinkissue29619 messages
2017-05-17 18:48:50haypocreate