Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fcntl module with wrong module for ioctl #36528

Closed
noah mannequin opened this issue Apr 30, 2002 · 2 comments
Closed

fcntl module with wrong module for ioctl #36528

noah mannequin opened this issue Apr 30, 2002 · 2 comments
Assignees
Labels
docs Documentation in the Doc dir

Comments

@noah
Copy link
Mannequin

noah mannequin commented Apr 30, 2002

BPO 550777
Nosy @freddrake

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/freddrake'
closed_at = <Date 2002-06-14.01:59:20.000>
created_at = <Date 2002-04-30.20:40:13.000>
labels = ['docs']
title = 'fcntl module with wrong module for ioctl'
updated_at = <Date 2002-06-14.01:59:20.000>
user = 'https://bugs.python.org/noah'

bugs.python.org fields:

activity = <Date 2002-06-14.01:59:20.000>
actor = 'fdrake'
assignee = 'fdrake'
closed = True
closed_date = None
closer = None
components = ['Documentation']
creation = <Date 2002-04-30.20:40:13.000>
creator = 'noah'
dependencies = []
files = []
hgrepos = []
issue_num = 550777
keywords = []
message_count = 2.0
messages = ['10625', '10626']
nosy_count = 2.0
nosy_names = ['fdrake', 'noah']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue550777'
versions = ['Python 2.2']

@noah
Copy link
Mannequin Author

noah mannequin commented Apr 30, 2002

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

@noah noah mannequin closed this as completed Apr 30, 2002
@noah noah mannequin assigned freddrake Apr 30, 2002
@noah noah mannequin added the docs Documentation in the Doc dir label Apr 30, 2002
@freddrake
Copy link
Member

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.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir
Projects
None yet
Development

No branches or pull requests

1 participant