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 lordsutch
Recipients
Date 2005-07-21.01:11:12
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=6757

The problem seems to be that Python integers are "long int,"
while the type expected by ioctl(2) is "unsigned long int"
(on AMD64, at least).

My hackish workaround is to coerce the ioctl number to a
signed quantity:

op = struct.unpack('i', struct.pack('I', op))[0]

Once it gets into the C code, the signed quantity is then
coerced back to unsigned long int by the ioctl call (after
an intermediate stop as (signed) int).

Probably, the correct course of action here is to figure out
what type ioctl(2) uses on a particular architecture and
adjust the PyArgs_ParseTuple() call and the type of "op"
accordingly.
History
Date User Action Args
2007-08-23 14:29:15adminlinkissue1112949 messages
2007-08-23 14:29:15admincreate