PERFORCE change 108176 for review
Roman Divacky
rdivacky at FreeBSD.org
Fri Oct 20 07:49:01 PDT 2006
http://perforce.freebsd.org/chv.cgi?CH=108176
Change 108176 by rdivacky at rdivacky_witten on 2006/10/20 14:48:12
Return EPERM when trying to setrlimit of maxfiles to over 1 milion.
Affected files ...
.. //depot/projects/linuxolator/src/sys/compat/linux/linux_misc.c#14 edit
Differences ...
==== //depot/projects/linuxolator/src/sys/compat/linux/linux_misc.c#14 (text+ko) ====
@@ -1111,6 +1111,13 @@
if (error)
return (error);
+ /*
+ * the 1024*1024 is a hardcoded constant of max files
+ * per proc in linux
+ */
+ if (which == RLIMIT_NOFILE && args->rlim > (1024*1024))
+ return (EPERM);
+
bsd_rlim.rlim_cur = (rlim_t)rlim.rlim_cur;
bsd_rlim.rlim_max = (rlim_t)rlim.rlim_max;
return (kern_setrlimit(td, which, &bsd_rlim));
More information about the p4-projects
mailing list