Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Oct 2006 14:48:56 GMT
From:      Roman Divacky <rdivacky@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 108176 for review
Message-ID:  <200610201448.k9KEmuKp058666@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=108176

Change 108176 by rdivacky@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));



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200610201448.k9KEmuKp058666>