Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Oct 2002 19:00:37 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Mike Barcroft <mike@FreeBSD.ORG>
Cc:        standards@FreeBSD.ORG
Subject:   Re: getpriority()/setpriority()
Message-ID:  <20021017183741.M9513-100000@gamplex.bde.org>
In-Reply-To: <20021016104523.G22315@espresso.q9media.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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




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