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

Use closefrom() to close open file descriptors #712

Merged
merged 1 commit into from
Nov 21, 2024

Commits on Nov 21, 2024

  1. Use closefrom() to close open file descriptors

    Replace the naive close() loop in js_os_exec with closefrom().
    
    On my system RLIMIT_NOFILE is set to 1 million and the delay from the
    loop gets noticeable when I spawn many processes.
    
    Use dlsym() to look up closefrom() because it's not available everywhere
    (looking at you, musl.)
    
    Fixes: quickjs-ng#711
    bnoordhuis committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    c74923b View commit details
    Browse the repository at this point in the history