?
Solved

Tring to find the source to connect in glibc-2.1

Posted on 2004-04-02
10
Medium Priority
?
205 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
10 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
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

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…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

770 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