[Patches] [ python-Patches-555883 ] fcntl.ioctl2 - fix for bug #555817

noreply@sourceforge.net noreply@sourceforge.net
Tue, 14 May 2002 17:51:18 -0700


Patches item #555883, was opened at 2002-05-14 22:04
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=555883&group_id=5470

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Anthony Baxter (anthonybaxter)
Assigned to: Anthony Baxter (anthonybaxter)
Summary: fcntl.ioctl2 - fix for bug #555817

Initial Comment:
See bug #555817 - the basics of it are that some 
ioctl calls rely on both getting back the modified 
third argument and the return code. Python's ioctl
implementation doesn't allow this. Linux docs explicitly
mention this, the solaris docs also say it's possible
(but not so explicitly). 

Anyway, this fix is a patch to fcntlmodule.c and a
test_ioctl.py script - it merely tries to use TIOCGPGRP
and compares it to os.getpgrp().


----------------------------------------------------------------------

>Comment By: Anthony Baxter (anthonybaxter)
Date: 2002-05-15 10:51

Message:
Logged In: YES 
user_id=29957

the else-bit - no reason, I'll fix it before I commit the
patch. I'll write the docs today and attach them. 

ioctl2 isn't my favourite, either, but I can't think of a 
better name. ioctl_that_returns_a_tuple() isn't any better,
ioctlt(), nioctl()... the '2' thing is reasonably common 
in C libraries...


----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2002-05-15 08:13

Message:
Logged In: YES 
user_id=21627

The patch looks good to me, but it probably needs
accompanying documentation patch.

Also:
- why do you put the ParseTuple in an if-else? It is common
to put the else part on the function level.
- would it be possible to find a more precise name than ioctl2?

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=555883&group_id=5470