In the refs related to <sys/types.h>
the type blkcnt_t
is defined as:
blkcnt_t Used for file block counts.
also it states:
blkcnt_t and off_t shall be signed integer types.
(see http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_types.h.html#tag_13_67)
I was unable to find the rationale for the number of blocks ever being negative, hence I wonder why the type is defined signed?
While I cannot imagine well the use of files having a negative number of blocks, I would think that blkcnt_t might be assigned a negative value to signify some sort of error/exceptional condition?
Fun fact is that the blkcnt_t type was introduced as unsigned (see here) and then later changed to be signed (see here). As description/rationale why this change happend this commit message is given:
"blkcnt_t and off_t shall be signed integer types." This causes pacman to fail when the size requirement of the net update operation is negative, instead it calculated a huge positive number.