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 module with wrong module for ioctl
Type: Stage:
Components: Documentation Versions: Python 2.2
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: fdrake Nosy List: fdrake, noah
Priority: normal Keywords:

Created on 2002-04-30 20:40 by noah, last changed 2022-04-10 16:05 by admin. This issue is now closed.

Messages (2)
msg10625 - (view) Author: Noah Spurrier (noah) Date: 2002-04-30 20:40
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
msg10626 - (view) Author: Fred Drake (fdrake) (Python committer) Date: 2002-06-14 01:59
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.
History
Date User Action Args
2022-04-10 16:05:17adminsetgithub: 36528
2002-04-30 20:40:13noahcreate