[Python-bugs-list] [ python-Bugs-550777 ] fcntl module with wrong module for ioctl

noreply@sourceforge.net noreply@sourceforge.net
Thu, 13 Jun 2002 18:59:20 -0700


Bugs item #550777, was opened at 2002-04-30 16:40
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=550777&group_id=5470

Category: Documentation
Group: Python 2.2.1 candidate
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Noah Spurrier (noah)
Assigned to: Fred L. Drake, Jr. (fdrake)
Summary: fcntl module with wrong module for ioctl

Initial Comment:
The documentation for fcntl.ioctl() gives the wrong 
module for definitions of ioctl operations.

    http://www.python.org/doc/lib/module-fcntl.html

    ioctl(fd, op, arg) 
    This function is identical to the fcntl()
    function, except that the operations are typically
    defined in the library module IOCTL. 

As far as I can tell, there is no IOCTL module.
I think what the documentation should say is the
termios module. The termios module defines various 
ioctl operation constants.

The following example demonstrates an ioctl operation
to get the current terminal window size.
#!/usr/bin/env python

import termios, fcntl, struct, sys

s = struct.pack("HHHH", 0, 0, 0, 0)
fd_stdout = sys.stdout.fileno()
x = fcntl.ioctl(fd_stdout, termios.TIOCGWINSZ, s)
print '(rows, cols, x pixels, y pixels) =',
print struct.unpack("HHHH", x)

Yours,
Noah


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

>Comment By: Fred L. Drake, Jr. (fdrake)
Date: 2002-06-13 21:59

Message:
Logged In: YES 
user_id=3066

These constants used to be defined in an IOCTL module, but
moved to the termios module.  This portion of the
documentation did not get updated appearantly.

Fixed in Doc/lib/libfcntl.tex revisions 1.29 and 1.28.6.1.

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

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