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?
EFAULTIt happen if the memory address of some argument passed tosendto(or more generally to any system call) is invalid. Think of it as a sort ofSIGSEGVin kernel land regarding your syscall. For instance, if you pass a null or invalid buffer pointer (for reading, writing, sending, recieving…), you get thatSee errno(3), sendto(2) etc… man pages.
EFAULTis not related to IP addresses at all.