[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] inttostr: add gidtostr and uidtostr

From: Eric Blake
Subject: Re: [PATCH] inttostr: add gidtostr and uidtostr
Date: Mon, 12 Aug 2013 07:50:00 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130805 Thunderbird/17.0.8

On 08/11/2013 05:44 PM, Paul Eggert wrote:
> I think the worry was that there are zillions of such types
> (mode_t, dev_t, pid_t, etc.), too many to define a function
> for each.  For valid gid_t and uid_t values one can use
> umaxtostr in practice, and there seemed to be little point
> to tuning for platforms where gid_t and uid_t are narrower than
> uintmax_t.

I don't know of any platforms where gid_t and uid_t are larger than int;
so libvirt just casts them to int (although it is feasible that such a
platform can be added, so it also uses verify() to be alerted at compile
time if those assumptions are wrong).  There ARE platforms where pid_t
(and thus id_t) are larger than long (namely 64-bit mingw has a 64-bit
pid_t but 32-bit long), requiring the use of uintmax_t.

Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]