This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: fcntl.ioctl2 - fix for bug #555817
Type: Stage:
Components: None Versions:
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: anthonybaxter Nosy List: anthonybaxter, loewis
Priority: normal Keywords: patch

Created on 2002-05-14 12:04 by anthonybaxter, last changed 2022-04-10 16:05 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
ioctl2.diff anthonybaxter, 2002-05-14 12:04 patch to Modules/fcntlmodule.c and a new Lib/test/test_ioctl.py
Messages (4)
msg40022 - (view) Author: Anthony Baxter (anthonybaxter) (Python triager) Date: 2002-05-14 12:04
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().
msg40023 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2002-05-14 22:13
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?
msg40024 - (view) Author: Anthony Baxter (anthonybaxter) (Python triager) Date: 2002-05-15 00:51
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...
msg40025 - (view) Author: Anthony Baxter (anthonybaxter) (Python triager) Date: 2002-05-16 12:16
Logged In: YES 
user_id=29957

marking as invalid in favour of a mutable array arg.
see bug #555817 for details.
History
Date User Action Args
2022-04-10 16:05:19adminsetgithub: 36604
2002-05-14 12:04:29anthonybaxtercreate