Skip to content

Ignore file creation flag in fcntl(F_SETFL) #4352

@tiif

Description

@tiif

For fcntl(F_SETFL), some file creation flags supposed to be ignored:

  F_SETFL (int)
        Set the file status flags to the value specified by arg.
         File access mode (O_RDONLY, O_WRONLY, O_RDWR) and file
        creation flags (i.e., O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC)
         in arg are ignored.  On Linux, this operation can change
        only the O_APPEND, O_ASYNC, O_DIRECT, O_NOATIME, and
         O_NONBLOCK flags.  It is not possible to change the O_DSYNC
         and O_SYNC flags; see BUGS, below.

source: https://man7.org/linux/man-pages/man2/fcntl.2.html

There is a list of file creation flags in https://man7.org/linux/man-pages/man2/open.2.html.

To resolve this issue, we just need to ignore every file creation flag, except O_APPEND, O_ASYNC, O_DIRECT, O_NOATIME and O_NONBLOCK.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-shimsArea: This affects the external function shimsC-enhancementCategory: a PR with an enhancement or an issue tracking an accepted enhancementE-good-first-issueA good way to start contributing, mentoring is available

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions