From owner-freebsd-standards Thu Oct 17 1:50: 1 2002 Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 40F4E37B401; Thu, 17 Oct 2002 01:50:00 -0700 (PDT) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1DACF43E42; Thu, 17 Oct 2002 01:49:59 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id SAA01054; Thu, 17 Oct 2002 18:49:57 +1000 Date: Thu, 17 Oct 2002 19:00:37 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Mike Barcroft Cc: standards@FreeBSD.ORG Subject: Re: getpriority()/setpriority() In-Reply-To: <20021016104523.G22315@espresso.q9media.com> Message-ID: <20021017183741.M9513-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wed, 16 Oct 2002, Mike Barcroft wrote: > It seems to me that the `who' (int) parameter for getpriority(2) and > setpriority(2) isn't capable of properly representing uid_t (unsigned > int) in the PRIO_USER case for UID's greater than 2^32/2. > > This appears to work in practice (though implicit overflow?), but I > think the correct thing to do would be to make the `who' parameter an > id_t (int64_t) and add compatibility osyscalls for existing software. > > The alternative is to make id_t an int and leave the syscalls alone, > with the exception of changing to spelling of int to id_t. uid_t is actually uint32_t, and POSIX requires `who' to have type id_t. u_int instead of int would work here (except on machines with 16-31 bit ints of course), since pgids are passed as themselves so there is no ned for the signed pid_t/(pgids passed as negative pids) hack. Unfortunately, POSIX.1-200x-draft7 specifies that id_t must contain pid_t, and even has a example where an id_t is is used to hold the result of getpid() :-(. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message