Check that write()/send() can process whole buffer without block, fail otherwise (no partial write)
I am using SOCK_SEQPACKET connection, and it is critical for me to ensure that whole buffer is sent with single write()/send() call. I am also operating with device driver that is designed to handle a complete block of data with single call. At the same time I want to handle the situation when write()/send() blocks due to buffer overflow, i.e. I want to have a feedback whether current implementation gets a bottleneck here. I'm working with glibc, Linux 2.6. I need to implement a method that accepts a buffer, and it either sends a buffer completely or indicates a failure due to blocking (i.e.