I'm writing a program involving network I/O, so send
and recv
are used, which are POSIX functions. They return a ssize_t
, which is POSIX-specific too.
The wrappers look like this ATM:
ssize_t sock_send(int sock, const void* msg, size_t len) {
return send(sock, msg, len, 0);
}
Even though I'm heavily depending on POSIX in my current implementation, I want to make the interface stick closely to the standard because I am planning on writing a Windows implementation later, where POSIX isn't necessarily available (dammit, Windows!).
What would be a good substitution for ssize_t
as specified by the C11 standard? Perhaps ptrdiff_t
?
Or how should I approach this issue otherwise?