Is 9 the errno value, or the return code from the sendmsg function?
Is there no error message?
sendmsg() should return the number of characters it sent, if a positive value.
EBADF, a bad file descriptor would correspond to an errno of 9, if that's the sort of error code you mean,
and if the code isn't from a different protocol layer.