Solved

Tring to find the source to connect in glibc-2.1

Posted on 2004-04-02
10
195 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
10 Comments
 
LVL 44

Accepted Solution

by:
Karl Heinz Kremer earned 50 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
 
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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

707 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now