Message10782
Logged In: YES
user_id=6656
OK, that would seem to be easy enough to implement (well,
the handling of writeable buffers, not all the optional
hair). I like this:
>>> buf = array.array('h', [0]*4)
[19139 refs]
>>> fcntl.ioctl(0, termios.TIOCGWINSZ, buf)
0
[19139 refs]
>>> buf
array('h', [47, 137, 841, 615])
[19139 refs]
I like this less:
>>> import array, fcntl
[19089 refs]
>>> buf = array.array('h', [0]*3)
[19093 refs]
>>> fcntl.ioctl(0, termios.TIOCGWINSZ, buf)
0
[19095 refs]
>>> del buf
Debug memory block at address p=0x401c3cb8:
6 bytes originally requested
The 4 pad bytes at p-4 are FORBIDDENBYTE, as expected.
The 4 pad bytes at tail=0x401c3cbe are not all
FORBIDDENBYTE (0xfb):
at tail+0: 0x67 *** OUCH
at tail+1: 0x02 *** OUCH
at tail+2: 0xfb
at tail+3: 0xfb
The block was made by call #16015 to debug malloc/realloc.
Data at p: 2f 00 89 00 49 03
Fatal Python error: bad trailing pad byte
Aborted
I'm not sure what we can possibly do about this? Copy into
a fixed buffer like we do today, then copy out again after
the ioctl? Probably the best option. |
|
Date |
User |
Action |
Args |
2007-08-23 14:01:21 | admin | link | issue555817 messages |
2007-08-23 14:01:21 | admin | create | |
|