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

2007-11-19 Thread fbvortex

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
pid,fd=pty.fork()
fcntl.ioctl(fd, termios.TIOCSWINSZ, struct.pack("",80,25,0,0))

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

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 <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1471>
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2007-11-19 Thread fbvortex

fbvortex added the comment:

The following C code, when compiled with -lutil runs without reporting
any errors on both the sparc64 and i386 platforms on OpenBSD:

#include 
#include 
#include 
#include 
#include 
 
int main(void)
{
int fd;
struct winsize w;
 
w.ws_row = 25;
w.ws_col = 80;
w.ws_xpixel = w.ws_ypixel = 0;
 
forkpty(&fd, NULL, NULL, NULL);
if (ioctl(fd,TIOCSWINSZ, &w) == -1)
perror("ioctl");
return 0;
}

__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1471>
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com