Hi,
On the Linux kernel 2.4.21-15.EL I’m facing a strange problem with recvfrom().
When recvfrom in a unix domain sockets server receives data from a unix domain socket called say “/var/hello” then it returns with the sockaddr_un.sun_path saying /var/hello\0 followed by trailing 0’s.
I do not memset the sockaddr_un data structure and do a recvfrom again and this time if it’s a socket called “/var/aaa” then it returns with the sockaddr_un.sunpath saying the sender is “/var/aaa\000lo” .
Hmm.. a little confusing,where did the two extra 0's from from after the first trailing 0, but .. still ok, if I do a printf of the sun_path I see what I want to, namely.. the /var/aaa
But then when I send from a socket with one more character than the last one.. say “/var/bbbb”
Then what I get in sun_path is !!!! “/var/bbbbo” . The o from the hello ! It did not add a trailing 0 after the /var/bbbb!
Is this a bug or what! ?
any idea anyone?
-Nikhil.