Skip to content

Add mutate_flag parameter for fcntl.fcntl #140597

@aisk

Description

@aisk

Feature or enhancement

Proposal:

fcntl.ioctl has a mutate_flag parameter. When set to True, it will pass the arg buffer to the underlying ioctl syscall directly. This is useful for receiving the result which will be written to the arg buffer.

However, fcntl.fcntl doesn't have this parameter, and it only returns bytes as the modified arg buffer. Users need to parse the bytes using the struct module, even if they have a well-defined structure that already implements the write buffer protocol.

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    extension-modulesC modules in the Modules dirstdlibStandard Library Python modules in the Lib/ directorytopic-IOtype-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions