Skip to content

Usage of O_NONBLOCK on jobserver fd's #3

@glance-

Description

@glance-

I was looking at this tool suite and the old android tool "makeparallel" and noted in the android source https://android.googlesource.com/platform/build/+/refs/tags/platform-tools-29.0.2/tools/makeparallel/makeparallel.cpp#254

// The file descriptor can't be set to O_NONBLOCK as that would affect

// all users of the pipe, including the parent make process.

As seen in jobcount.c:20 , it sets O_NONBLOCK and also never resets it. I think this would be a issue for anything else using the jobserver.

I suggest using the same approach as makeparallel did, to do blocking reads with a short alarm that will kick the reader out of the blocking state upon block.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions