All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wright <chrisw@osdl.org>
To: Chris Wright <chrisw@osdl.org>
Cc: Matt Mackall <mpm@selenic.com>,
	Michael Kerrisk <mtk-manpages@gmx.net>,
	mingo@elte.hu, linux-kernel@vger.kernel.org,
	michael.kerrisk@gmx.net, akpm@osdl.org
Subject: Re: Broke nice range for RLIMIT NICE
Date: Fri, 29 Jul 2005 13:51:20 -0700	[thread overview]
Message-ID: <20050729205120.GJ19052@shell0.pdx.osdl.net> (raw)
In-Reply-To: <20050729201836.GH19052@shell0.pdx.osdl.net>

* Chris Wright (chrisw@osdl.org) wrote:
> Yes, this requires updated pam patch.

Here's the updated pam patch.  I left the lower end at 0 rather than 1,
since it's no harm.

--- Linux-PAM-0.77/modules/pam_limits/pam_limits.c.prio	2005-01-14 10:47:03.000000000 -0800
+++ Linux-PAM-0.77/modules/pam_limits/pam_limits.c	2005-01-14 10:55:13.000000000 -0800
@@ -39,6 +39,11 @@
 #include <grp.h>
 #include <pwd.h>
 
+/* Hack to test new rlimit values */
+#define RLIMIT_NICE	13
+#define RLIMIT_RTPRIO	14
+#define RLIM_NLIMITS	15
+
 /* Module defines */
 #define LINE_LENGTH 1024
 
@@ -293,6 +298,10 @@ static void process_limit(int source, co
     else if (strcmp(lim_item, "locks") == 0)
 	limit_item = RLIMIT_LOCKS;
 #endif
+    else if (strcmp(lim_item, "rt_priority") == 0)
+	limit_item = RLIMIT_RTPRIO;
+    else if (strcmp(lim_item, "nice") == 0)
+	limit_item = RLIMIT_NICE;
     else if (strcmp(lim_item, "maxlogins") == 0) {
 	limit_item = LIMIT_LOGIN;
 	pl->flag_numsyslogins = 0;
@@ -360,6 +369,19 @@ static void process_limit(int source, co
         case RLIMIT_AS:
             limit_value *= 1024;
             break;
+        case RLIMIT_NICE:
+            limit_value = 20 - limit_value;
+            if (limit_value > 40)
+		limit_value = 40;
+	    if (limit_value < 0)
+		limit_value = 0;
+            break;
+        case RLIMIT_RTPRIO:
+            if (limit_value > 99)
+		limit_value = 99;
+	    if (limit_value < 0)
+		limit_value = 0;
+            break;
     }
 
     if ( (limit_item != LIMIT_LOGIN)

  reply	other threads:[~2005-07-29 20:54 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-28 15:04 Broke nice range for RLIMIT NICE Michael Kerrisk
2005-07-28 17:43 ` Andrew Morton
2005-07-29 11:29   ` [PATCH] MAINTAINERS record -- MAN-PAGES Michael Kerrisk
2005-07-29  6:13 ` Broke nice range for RLIMIT NICE Matt Mackall
2005-07-29  8:38   ` Ingo Molnar
2005-07-29 10:42     ` Michael Kerrisk
2005-07-29 14:50       ` Nix
2005-07-29 15:14         ` Michael Kerrisk
2005-07-29 20:57           ` Nix
2005-07-29 10:40   ` Michael Kerrisk
2005-07-29 20:18   ` Chris Wright
2005-07-29 20:51     ` Chris Wright [this message]
2005-07-29 21:02       ` Lee Revell
2005-07-29 21:07         ` Chris Wright
2005-08-15 20:13   ` [PATCH] Fix " Matt Mackall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050729205120.GJ19052@shell0.pdx.osdl.net \
    --to=chrisw@osdl.org \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.kerrisk@gmx.net \
    --cc=mingo@elte.hu \
    --cc=mpm@selenic.com \
    --cc=mtk-manpages@gmx.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.