From owner-freebsd-bugs Mon Mar 24 15:50:17 2003 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 53D1537B404 for ; Mon, 24 Mar 2003 15:50:13 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id C421E43FB1 for ; Mon, 24 Mar 2003 15:50:11 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id h2ONoBNS081553 for ; Mon, 24 Mar 2003 15:50:11 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id h2ONoB5c081552; Mon, 24 Mar 2003 15:50:11 -0800 (PST) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D105237B401 for ; Mon, 24 Mar 2003 15:41:27 -0800 (PST) Received: from mailman.precisionio.com (dns.precisionio.net [65.192.41.225]) by mx1.FreeBSD.org (Postfix) with ESMTP id 45C5943F75 for ; Mon, 24 Mar 2003 15:41:27 -0800 (PST) (envelope-from archie@precisionio.com) Received: from bubba.precisionio.com (bubba.precisionio.com [172.16.0.223]) by mailman.precisionio.com (8.12.8/8.12.6) with ESMTP id h2OKCRnr032945 for ; Mon, 24 Mar 2003 12:12:27 -0800 (PST) (envelope-from archie@precisionio.com) Received: from bubba.precisionio.com (localhost [127.0.0.1]) by bubba.precisionio.com (8.12.7/8.12.7) with ESMTP id h2OKCQoX075160 for ; Mon, 24 Mar 2003 12:12:26 -0800 (PST) (envelope-from archie@bubba.precisionio.com) Received: (from archie@localhost) by bubba.precisionio.com (8.12.7/8.12.7/Submit) id h2OKCQFX075159; Mon, 24 Mar 2003 12:12:26 -0800 (PST) Message-Id: <200303242012.h2OKCQFX075159@bubba.precisionio.com> Date: Mon, 24 Mar 2003 12:12:26 -0800 (PST) From: Archie Cobbs Reply-To: Archie Cobbs To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/50260: can't get my own policy from sched_getscheduler() X-Spam-Status: No, hits=-0.8 required=5.0 tests=RESENT_TO version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 50260 >Category: bin >Synopsis: can't get my own policy from sched_getscheduler() >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Mar 24 15:50:11 PST 2003 >Closed-Date: >Last-Modified: >Originator: Archie Cobbs >Release: FreeBSD 4.7-STABLE i386 >Organization: Packet Design >Environment: System: FreeBSD bubba.precisionio.com 4.7-STABLE FreeBSD 4.7-STABLE #0: Tue Feb 18 09:50:02 PST 2003 archie@bubba.packetdesign.com:/usr/obj/usr/src/sys/BUBBA i386 >Description: sched_getscheduler(0) returns EPERM. Why can't a process get it's own scheduling policy?? SUSv2 seems to state explicitly that it should be able to: > If a process specified by pid exists and if the calling process has > permission, the scheduling policy will be returned for the process > whose process ID is equal to pid. > > If pid is zero, the scheduling policy will be returned for the > calling process. Ref: http://www.opengroup.org/onlinepubs/7908799/xsh/sched_getscheduler.html >How-To-Repeat: #include #include #include #include #include int main(int ac, char **av) { int policy; int min_prio; int max_prio; if ((policy = sched_getscheduler(0)) == -1) err(1, "sched_getscheduler"); printf("policy = %d\n", policy); if ((min_prio = sched_get_priority_min(policy)) == -1) err(1, "sched_get_priority_min"); if ((max_prio = sched_get_priority_max(policy)) == -1) err(1, "sched_get_priority_max"); printf("max = %d\n", max_prio); printf("min = %d\n", min_prio); return 0; } >Fix: >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message