Skip to content

Setting ulimit inside PowerShell #847

Closed

Description

While setting up the OS X build, I encountered a funny issue. Running ulimit -n 4096 inside PowerShell had no effect, so I had to run it before launching the PowerShell process. Now, ulimit is both a Bash built-in and a native command on OS X. My guess is that, when running from PowerShell, it was launched as a child process (of course) and so the system call to setrlimit only affected the launched child process, not PowerShell itself.

I think the appropriate fix would be to add a built-in ulimit function to PowerShell that called setrlimit in-proc, thus modifying the current process's open file descriptor limit.

This is a total edge case that we should take care of at some point, but I don't think it's super high priority.

Activity

  1. andyleejordan commented on Oct 7, 2016

    @andyleejordan
    MemberAuthor

    This would be a great feature for Hacktoberfest. It's (probably) just a bit of Linux/OS X native code added to libpsl-native and a new PowerShell cmdlet that P/Invokes it.

  2. added
    Up-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributors
    on Oct 17, 2016
  3. added this to the milestone on Mar 5, 2017
  4. SteveL-MSFT commented on Apr 26, 2018

    @SteveL-MSFT
    Member

    Related #6725

  5. adityapatwardhan commented on Feb 25, 2021

    @adityapatwardhan
    Member

    The prototype is located at: https://github.com/PowerShell/UnixUtils

    We need to release it to powershell gallery when time permits.

    GitHub
    GitHub is where people build software. More than 56 million people use GitHub to discover, fork, and contribute to over 100 million projects.
  6. removed
    Up-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributors
    on Jun 17, 2021
  7. kilasuit commented on Sep 28, 2024

    @kilasuit
    Collaborator

    The prototype is located at: https://github.com/PowerShell/UnixUtils

    We need to release it to powershell gallery when time permits.

    Did this ever get released Steve Lee (@SteveL-MSFT) / Aditya Patwardhan (@adityapatwardhan) ?

    GitHub
    GitHub is where people build software. More than 100 million people use GitHub to discover, fork, and contribute to over 420 million projects.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Issue-Enhancementthe issue is more of a feature request than a bugResolution-No ActivityIssue has had no activity for 6 months or moreWG-DevEx-Portabilityauthoring cross-platform or cross-architecture modules, cmdlets, and scripts

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions