Skip to content
Snippets Groups Projects
Commit 4854d072 authored by Simon McVittie's avatar Simon McVittie
Browse files

pv-wrap, pv-launcher: Set a reasonable RLIMIT_NOFILE

We could inherit any RLIMIT_NOFILE from Steam or another caller, but
we want to give games a predictable execution environment.

If a game uses select(), allocates memory proportional to the soft limit
on file descriptors, or loops for a number of iterations proportional to
the soft limit on file descriptors (as we did prior to commit 97b5a8f6
"pressure-vessel: Let short-term subprocesses inherit non-CLOEXEC fds"),
then file descriptors numerically greater than 1023 are going to be a
problem. If the soft limit is more than 1024 (= FD_SETSIZE), reduce it
to 1024 to avoid this.

Conversely, if we're launched with a soft limit strictly less than 1024,
let's try to raise it to 1024 if the hard limit allows that.

Related to <https://github.com/ValveSoftware/steam-for-linux/issues/7970

>.

Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
parent a50fb11d
No related branches found
No related tags found
1 merge request!353pv-wrap, pv-launcher: Set a reasonable RLIMIT_NOFILE
Pipeline #16519 passed
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment