Rationale for system calls that allow request of size_t but result of only ssize_t?

Consider:

ssize_t write(int fd, const void *buf, size_t count);

The result has to be signed to account for -1 on error, etc., and is thus ssize_t. But why then allow for the request to be an unsigned amount (twice as large) when the result of asking for more than ssize_t is undefined?

Is there a significant optimization in the kernel by virtue of not checking for signedness of the count parameter? Or something else?

9
задан ValenceElectron 2 May 2011 в 16:38
поделиться