The general function for sending data over TCP socket is below:
ssize_t send(int sockfd, const void *buffer, size_t length, int flags);
Generally, the TCP will fragment the data if data size is more that MSS. But it is said that send() API will send the 'length' amount of data and returns whatever amount of data could be sent to outgoing buffer and its the responsibility of the developer to check the return value and resend the remaining data.
So my doubt it, then if the 'length' value is more than MSS, will not TCP automatically fragment the data? If no, then how can we make the TCP to fragment the data internally with one send() call?