Does anyone know why did the definitions of many functions in the C standard library got changed to return ssize_t instead of int? For instance read and write, both returning -1 in case of error, whilst all declarations of ssize_t I've seen are unsigned. What is this crazyness?
Name:
Anonymous2015-07-24 2:51
>>3 Where I'm sitting, ssize_t is defined in terms of __SWORD_TYPE, which is int for 32-bit and long int for 64-bit platforms. So it's signed; materially the only change from returning int is that there may be large return values on 64-bit plats. This is reasonable because the size parameter can also be large on 64-bit.