This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jcea
Recipients jcea
Date 2014-12-21.22:36:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1419201384.94.0.109155979555.issue23098@psf.upfronthosting.co.za>
In-reply-to
Content
Dan MacDonald told me that "os.mknod()" should accept devices >32 bits.

I wrote this code in linux 64 bits:

"""
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>

int main(void) {
    printf("%d", sizeof(dev_t));
    return 0;
}
"""

The result of running this is "8". We need a long long.

I did this change in Python 2.7 branch:

"""
diff -r f00412d32b41 Modules/posixmodule.c
--- a/Modules/posixmodule.c	Sat Dec 20 13:41:14 2014 -0600
+++ b/Modules/posixmodule.c	Sun Dec 21 23:30:00 2014 +0100
@@ -7009,9 +7009,9 @@
 {
     char *filename;
     int mode = 0600;
-    int device = 0;
+    long long device = 0;
     int res;
-    if (!PyArg_ParseTuple(args, "s|ii:mknod", &filename, &mode, &device))
+    if (!PyArg_ParseTuple(args, "s|iL:mknod", &filename, &mode, &device))
         return NULL;
     Py_BEGIN_ALLOW_THREADS
     res = mknod(filename, mode, device);
"""

Looks like this patch is trivial. Please, comment.
History
Date User Action Args
2014-12-21 22:36:24jceasetrecipients: + jcea
2014-12-21 22:36:24jceasetmessageid: <1419201384.94.0.109155979555.issue23098@psf.upfronthosting.co.za>
2014-12-21 22:36:24jcealinkissue23098 messages
2014-12-21 22:36:24jceacreate