Add support for /proc/[pid]/limits
This adds support for the /proc/[pid]/limits file to view information from ulimit or setrlimit. It prints the output in the exact format that the Linux kernel uses, which is hand-spaced columns instead of tabs or a columnar printer. In order to support the file format, helpers have been added to get the textual names and units for the limit types.
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
View this failed invocation of the CLA check for more information.
For the most up to date status, view the checks section at the bottom of the pull request.
Need to add a test case in https://github.com/google/gvisor/blob/master/test/syscalls/linux/rlimits.cc.
The PR looks good overall.
Need to add a test case in https://github.com/google/gvisor/blob/master/test/syscalls/linux/rlimits.cc.
Can do, forgot about the C++ tests. What test case were you thinking of? That changing the various limits shows up in the proc file?
@jseba I think about something very basic: read a file and check one or two limits are shown properly.
Apologies for taking so long to get back to this, I rebased and added a simple unit test to read the limits file after changing it via setrlimit
@avagin friendly ping when you get a chance to review again, I'd appreciate it
@jseba pls merge the fix to the proper commit.
@jseba pls merge the fix to the proper commit.
Do I rebase it into the unit test commit and force push?
@jseba yes. We want to have the clean history in the main repo.
@jseba yes. We want to have the clean history in the main repo.
gotcha, not sure how copybara works but I squashed the unit test fix into its commit, let me know if I need to squash the whole PR into one commit