From owner-p4-projects@FreeBSD.ORG Fri Oct 20 14:49:01 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id F231716A47E; Fri, 20 Oct 2006 14:49:00 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B5A6616A415 for ; Fri, 20 Oct 2006 14:49:00 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7D4E643D68 for ; Fri, 20 Oct 2006 14:49:00 +0000 (GMT) (envelope-from rdivacky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k9KEmvQC058669 for ; Fri, 20 Oct 2006 14:48:57 GMT (envelope-from rdivacky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k9KEmuKp058666 for perforce@freebsd.org; Fri, 20 Oct 2006 14:48:56 GMT (envelope-from rdivacky@FreeBSD.org) Date: Fri, 20 Oct 2006 14:48:56 GMT Message-Id: <200610201448.k9KEmuKp058666@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to rdivacky@FreeBSD.org using -f From: Roman Divacky To: Perforce Change Reviews Cc: Subject: PERFORCE change 108176 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Oct 2006 14:49:01 -0000 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));