Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Tring to find the source to connect in glibc-2.1

Posted on 2004-04-02
10
Medium Priority
?
213 Views
Last Modified: 2010-04-21
I have glibc-2.1 source, my target is i386. Someone else built the libc.so, and I have access to the build tree. But I am having difficulty locating the source to connect. I can find the connect.o file in build-i386-linux/socket, but I am having diffculty located the file source for it. I have not looked through the make files yet to see if what target creates the connect. I thought I would ask here first.

Thanks
0
Comment
Question by:Anthony2000
  • 5
  • 3
8 Comments
 
LVL 44

Accepted Solution

by:
Karl Heinz Kremer earned 200 total points
ID: 10745299
I don't have the glibc-2.1 sources installed, but in 2.3.x the file is here:
./sysdeps/generic/connect.c

0
 
LVL 8

Author Comment

by:Anthony2000
ID: 10869294
khkremer:

I found the start of it. The main code I was looking for is in the kernel. If you follow through the glibc source to connect, accept, socket, etc., you will find that the kernel is entered through sys_socketcall (entry.S function number 102).
From there a call sys_connect (kernel/net/socket.c) brings you to (unix_stream_connect or unix_dgram_connect (kernel/net/unix/af_unix.c). This is what I was looking for.

Since you were the only one to take a stab, I am closing this question and giving you the points.

Thanks,

Anthony
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 10871531
All the system calls are implemented in the kernel (that's why they are called system calls). The glibc only provides the interface that a "normal" process uses. It does relay the call to the kernel. You did ask for the source in gllibc, and that's what I provided.
If you are not happy with the answer, you should have said so before giving a "C" grade. Are you familiar with the EE grading guidelines? You can find them here: http://www.experts-exchange.com/help.jsp#hi73
Given that I answered the question (the one you asked, maybe not the one you intended to ask), I think a "C" is not deserved. I'll request a grade review.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 8

Author Comment

by:Anthony2000
ID: 10874349
khkremer, I am sorry if I offended you. I gave you a "c" because when you look at the source to connect in glibc, it does nothing but make a call to the kernel.  I was hoping that someone would explain that the source to connect in glibc does nothing but pass the call onto the kernel to perform the majority of work. Would a "B" be more appropriate? I very much appreciate your help and again please forgive the grade. Let me know.
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 10876466
Why didn't you ask before closing the question?
0
 
LVL 8

Author Comment

by:Anthony2000
ID: 10880207
I was trying to solve a problem where I was experiencing a lockup during boot. I found that the lockup was occurring during the rc.sysinit (I am using a version of RedHat version 6.2). The lockup was occurring in some code that I added. It turned out to be in a function called action. action calls initlog. Whenever the system locked up it was during this command. I added strace to the mix and discovered that it was happening during the call to connect. I should have explained all of this so that you could have better helped me. This at first seemed like a major problem.  If I run syslog, the problem goes away, but  syslog does not run until rc.sysinit  has completed. I searched the web looking for others who might have had the same problem, but could not find anything related.

For some reason, the connect locks up sometimes when syslog daemon is not running. I can duplicate this at a bash prompt on my embedded system.  I have not tried on my machine running 6.2 yet.  The more important thing was to correct my problem with booting.

I was almost going to retract the question, but I thought that since you took the time to try to help me and the points were only 50 that I would award them to you. Again, I am sorry for the way I handled this and I appreciate your time and help.
0
 
LVL 8

Author Comment

by:Anthony2000
ID: 10880223
BTW: I closed the question because I had a work around and needed to move onto other work.
0
 
LVL 8

Author Comment

by:Anthony2000
ID: 10880329
GhostMod can you please change the grade to "A".

khkremer did answer the question correctly.

Thanks,

Anthony
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
The Relationships Diagram is a good way to get an overall view of what a database is keeping track of. It is also where relationships are defined. A relationship specifies how two tables connect to each other. As you build tables in Microsoft Ac…
Suggested Courses

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question