Message57697
I can also reproduce this on OpenBSD/amd64 and was one of the people who
discussed it with the submitter before he created this report.
> So what's the definition of struct winsize on these systems?
The definition of struct winsize on both 32-bit and 64-bit OpenBSD
platforms is:
struct winsize {
unsigned short ws_row; /* rows, in characters */
unsigned short ws_col; /* columns, in characters */
unsigned short ws_xpixel; /* horizontal size, pixels */
unsigned short ws_ypixel; /* vertical size, pixels */
};
We have verified that (sizeof (struct winsize)) is 8 on all three
platforms (32-bit i386, and 64-bit amd64 and sparc64).
> Also, why do you think this is a bug in Python? AFAICT, the specific
> ioctl call does not occur in Python, but in your own code.
This Python code fails:
fcntl.ioctl(fd, termios.TIOCSWINSZ, struct.pack("HHHH",80,25,0,0))
(Error: IOError: [Errno 25] Inappropriate ioctl for device) This code
also fails with the same error message (I would expect EINVAL instead):
fcntl.ioctl(0, termios.TIOCSWINSZ, "")
Corresponding test C code to call the ioctl (as listed in a previous
message) works without problems on all three platforms. I don't know how
Python fcntl.ioctl works and perhaps the problem is not Python, but I am
having to try fairly hard to think what else could be involved.
The constant appears to be the correct ioctl number. (Python code:
python2.5 -c 'import termios; print "%d" % (termios.TIOCSWINSZ)'
matches C code:
#include <termios.h>
int main(void) { printf("%ld\n", TIOCSWINSZ); }
on all three platforms.)
I am told it works on Linux. However, Linux declares ioctl as:
int ioctl(int d, int request, ...);
So 'request' is 32-bits, but on OpenBSD ioctl is declared as:
int ioctl(int d, unsigned long request, ...);
So on amd64 and sparc64, 'request' is 64-bits. Could this be a factor?
-- Nicholas. |
|
| Date |
User |
Action |
Args |
| 2007-11-20 09:25:20 | nicm | set | spambayes_score: 0.00366028 -> 0.0036602789 recipients:
+ nicm, loewis, fbvortex |
| 2007-11-20 09:25:19 | nicm | set | spambayes_score: 0.00366028 -> 0.00366028 messageid: <1195550719.59.0.778909076579.issue1471@psf.upfronthosting.co.za> |
| 2007-11-20 09:25:19 | nicm | link | issue1471 messages |
| 2007-11-20 09:25:18 | nicm | create | |
|