LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 06-27-2005, 09:59 AM   #1
nkshirsagar
LQ Newbie
 
Registered: Nov 2004
Posts: 22

Rep: Reputation: 0
problem with recvfrom() in linux kernel .4.21-15.EL??


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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Why does a multithreaded program gets hanged at recvfrom()? kranti Programming 1 10-17-2005 10:44 AM
Why does a multithreaded program gets hanged at recvfrom()? kranti Linux - Newbie 1 10-17-2005 04:40 AM
Why does a multithreaded program gets hanged at recvfrom()? kranti Linux - General 1 10-17-2005 04:09 AM
Problem in recvfrom() live_dont_exist Programming 5 05-08-2005 04:25 PM
recvfrom() takes 20 ms to return? pingswept Programming 3 05-25-2004 03:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 04:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration