I have a very simple question, but I have not managed to find any answers to it all weekend. I am using the sendto()
function and it is returning error code 14: EFAULT. The man pages describe it as:
"An invalid user space address was specified for an argument."
I was convinced that this was talking about the IP address I was specifying, but now I suspect it may be the memory address of the message buffer that it is referring to - I can't find any clarification on this anywhere, can anyone clear this up?
EFAULT
It happen if the memory address of some argument passed to sendto
(or more generally to any system call) is invalid. Think of it as a sort of SIGSEGV
in kernel land regarding your syscall. For instance, if you pass a null or invalid buffer pointer (for reading, writing, sending, recieving...), you get that
See errno(3), sendto(2) etc... man pages.
EFAULT
is not related to IP addresses at all.