From dc4f45eb6874331daec870dc1e4cfc3ac5c49311 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 8 Apr 2019 22:31:46 +0100 Subject: lib: Use nr_open not file-max for setting fd rlimit Petri pointed out that the maximum allowed number of files per process is nr_open, not the system cap of file-max. Suggested-by: Petri Latvala Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110351 Signed-off-by: Chris Wilson Cc: Lucas De Marchi Cc: Petri Latvala Reviewed-by: Petri Latvala --- lib/igt_aux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/igt_aux.c b/lib/igt_aux.c index 266aa832..02f4defb 100644 --- a/lib/igt_aux.c +++ b/lib/igt_aux.c @@ -1595,7 +1595,7 @@ bool igt_allow_unlimited_files(void) struct rlimit rlim; unsigned nofile_rlim = 1024*1024; - FILE *file = fopen("/proc/sys/fs/file-max", "r"); + FILE *file = fopen("/proc/sys/fs/nr_open", "r"); if (file) { igt_assert(fscanf(file, "%u", &nofile_rlim) == 1); igt_info("System limit for open files is %u\n", nofile_rlim); -- cgit v1.2.3