Does in glibc, the sizeof(ssize_t) always equals to sizeof(size_t)
Paul Eggert
eggert@cs.ucla.edu
Fri May 22 17:58:04 GMT 2026
On 2026-05-22 10:50, Yonggang Luo wrote:
> Do you mean (OSF/1, UNICOS, late old AmigaOS/AROS/MorphOS, old TRON) ,
> these lists of OS have sizeof(ssize_t)!=sizeof(size_t)?
Yes, that's what I meant. They all had ssize_t narrower than size_t.
This was for backward compatibility, e.g., their 'read' syscall always
returned a 32-bit signed int even though size_t was 64 bits. In some of
the really-old systems the issue was 16-bit signed int vs 32-bit size_t.
Perhaps this could happen in the future with 64-bit ssize_t and 128-bit
size_t, right? Though that would be pretty far in the future.
More information about the Libc-alpha
mailing list