summaryrefslogtreecommitdiff
path: root/code/snippets/exceeding_soft_rlimits.rb
blob: 4b6f2eda231b13f17630a40128c38630b6c9e12f (plain)
1
2
3
4
5
6
7
# Set the maximum number of open files to 3. We know this
# will be maxed out because the standard streams occupy
# the first three file descriptors.
Process.setrlimit(:NOFILE, 3)

File.open('/dev/null')