Re: FreeBSD and sysconf(_SC_GETPW_R_SIZE_MAX)

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

 



On 05/16/2011 03:03 PM, Eric Blake wrote:
>> getpwnam() returns ERANGE if the allocated buffer is too small. So
>> we should do something along the lines of
>>
>>     size_t len = sysconf(_SC_GETPW_R_SIZE_MAX)
> 
> Guarded by #ifdef, and defaulting to -1 if _SC_GETPW_R_SIZE_MAX is not
> defined (since it is a handy extension, but not present everywhere).

Or not - we only use it inside #if HAVE_FUNC_GETPWNAM_R and friends; so
far, all platforms that have the *_r functions also happen to have a
decent set of sysconf() names where we aren't running into compilation
errors by trying to use _SC_GETPW_R_SIZE_MAX.

> But indeed this is the correct response.

I've posted
https://www.redhat.com/archives/libvir-list/2011-May/msg01074.html

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]