Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
how to find glibc sorce code
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Jackie Lin
Tux's lil' helper
Tux's lil' helper


Joined: 31 May 2017
Posts: 115

PostPosted: Sun Oct 27, 2019 10:57 am    Post subject: how to find glibc sorce code Reply with quote

Hi,
I want to read the source code of a function in C standard library.
How could I find the glibc source code in system?
and what about the C++ STL source code?

Thanks!
_________________
peace, focus.
Back to top
View user's profile Send private message
nick_gentoo
Tux's lil' helper
Tux's lil' helper


Joined: 07 Jan 2019
Posts: 140

PostPosted: Sun Oct 27, 2019 11:09 am    Post subject: Reply with quote

The downloaded sources of the installed packages are kept in the DISTDIR directory, defined in make.conf. There is a good chance that it is /usr/portage/distfiles.
The C library code is in the glibc archive.
The C++ standard library code is directly in gcc, I think...
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54603
Location: 56N 3W

PostPosted: Sun Oct 27, 2019 11:37 am    Post subject: Reply with quote

Jackie Lin,

Code:
ebuild /full/path/to/ebuild unpack
will unpack the sources for your package of choice.
See also the prepare phase.

Sources will be downloaded if they are needed.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
fturco
Veteran
Veteran


Joined: 08 Dec 2010
Posts: 1181

PostPosted: Sun Oct 27, 2019 2:46 pm    Post subject: Reply with quote

@Jackie Lin: See https://sourceware.org/git/?p=glibc.git
Back to top
View user's profile Send private message
GDH-gentoo
Veteran
Veteran


Joined: 20 Jul 2019
Posts: 1727
Location: South America

PostPosted: Sun Oct 27, 2019 3:13 pm    Post subject: Reply with quote

nick_gentoo wrote:
The C++ standard library code is directly in gcc, I think...

Yes, it is in library libstdc++, which is provided by GCC. Code can also be viewed here: https://gcc.gnu.org/git/?p=gcc.git
Back to top
View user's profile Send private message
Jackie Lin
Tux's lil' helper
Tux's lil' helper


Joined: 31 May 2017
Posts: 115

PostPosted: Wed Oct 30, 2019 9:11 am    Post subject: Reply with quote

Thanks!
_________________
peace, focus.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum