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

host name limit in SUSv2



Igor Khavkine <i_khavki@alcor.concordia.ca> writes:

> Just look in the page for gethostname(), xns/gethostname.html.

I think the right way is the usual malloc/gethostname/realloc loop,
but start out with an allocation of 255 bytes. This way, SUS-compliant
systems should always find enough space on the first iteration. One
can assume, that other systems that support longer hostnames will
return a good error value, although SUS defines no specific error
codes.

-- 
Robbe

Attachment: signature.ng
Description: PGP signature


Reply to: