Skip to content

tail: unnecessary pipe2 syscall for empty files #12464

@dragutreis

Description

@dragutreis

Description:
When running tail -c +1 /dev/null, tail makes an unnecessary pipe2
syscall even though the file is empty and has no data to transfer.
The pipe creation is wasteful in this case.

Steps to reproduce:

strace -c -e pipe,pipe2 tail -c +1 /dev/null

Expected behavior: No pipe2 syscall for empty/exhausted files.

Actual behavior: 1 pipe2 call despite nothing to transfer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions