We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Windows build number:
>ver Microsoft Windows [Version 10.0.18362.295]
What I'm doing and what's happening:
Use any C compiler to produce binaries for WSL and any POSIX for the following source file:
#include <errno.h> #include <stdio.h> #include <sys/resource.h> #include <sys/time.h> #include <sys/types.h> #include <unistd.h> int main() { struct rlimit rlp = {1, 4}; if (setrlimit(RLIMIT_NPROC, &rlp) < 0) goto handle; rlp.rlim_cur = 0; rlp.rlim_max = 0; if (getrlimit(RLIMIT_NPROC, &rlp) < 0) goto handle; printf("Process limits: (%llu, %llu)\n", rlp.rlim_cur, rlp.rlim_max); if (fork() < 0) goto handle; printf("Hello 1\n"); if (fork() < 0) goto handle; printf("Hello 2\n"); if (fork() < 0) goto handle; printf("Hello 3\n"); return 0; handle: perror(NULL); return 1; }
What's wrong / what should be happening instead:
The outputs on the two systems differ. Here is the correct output produced on my Ubuntu system:
$ ./a.out Process limits: (1, 4) Resource temporarily unavailable
And here is the output from WSL(Ubuntu):
$ ./a.out Process limits: (1, 4) Hello 1 Hello 1 Hello 2 Hello 2 Hello 2 Hello 2 Hello 3 Hello 3 Hello 3 Hello 3 Hello 3 Hello 3 Hello 3 Hello 3
setrlimit returns 0 to indicate success, even though the hard process limit isn't being set, which permits all of the forks to successfully execute.
setrlimit
Strace of the command here
The text was updated successfully, but these errors were encountered:
Spiritually similar to #3505. setrlimit(2) on WSL1 is.... limited.
setrlimit(2)
Sorry, something went wrong.
No branches or pull requests
Windows build number:
What I'm doing and what's happening:
Use any C compiler to produce binaries for WSL and any POSIX for the following source file:
What's wrong / what should be happening instead:
The outputs on the two systems differ. Here is the correct output produced on my Ubuntu system:
And here is the output from WSL(Ubuntu):
setrlimit
returns 0 to indicate success, even though the hard process limit isn't being set, which permits all of the forks to successfully execute.Strace of the command here
The text was updated successfully, but these errors were encountered: