[New-bugs-announce] [issue1471] ioctl doesn't work properly on 64-bit OpenBSD

fbvortex report at bugs.python.org
Tue Nov 20 01:27:07 CET 2007

New submission from fbvortex:

The following lines of code work on Linux platforms (amd64), and 32-bit
OpenBSD (i386), but not on 64-bit OpenBSD platforms (at least not on
amd64 or sparc64):

import fcntl,os,pty,termios,select,sys,struct,pwd,signal,os
fcntl.ioctl(fd, termios.TIOCSWINSZ, struct.pack("HHHH",80,25,0,0))

This gives an "IOError: [Errno 25] Inappropriate ioctl for device"

The python version in question on OpenBSD is:

Python 2.5.1 (r251:54863, Nov 16 2007, 18:16:44) 
[GCC 3.3.5 (propolice)] on openbsd4

The winsize structure as dumped using sizeof(struct winsize) under
OpenBSD/sparc64 is 8 bytes large, and so is the result from the
struct.pack operation.  Forcing the endianness big or little in the
struct.pack formatting string has no effect on the error.

messages: 57673
nosy: fbvortex
severity: normal
status: open
title: ioctl doesn't work properly on 64-bit OpenBSD
type: behavior
versions: Python 2.5

Tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list