Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is the implementation of strlen() in GCC?

Tags:

c

glibc

strlen

Can anyone point me to the definition of strlen() in GCC? I've been grepping release 4.4.2 for about a half hour now (while Googling like crazy) and I can't seem to find where strlen() is actually implemented.

like image 710
Chris Tonkinson Avatar asked Sep 03 '25 15:09

Chris Tonkinson


1 Answers

You should be looking in glibc, not GCC -- it seems to be defined in strlen.c -- here's a link to strlen.c for glibc version 2.7... And here is a link to the glibc SVN repository online for strlen.c.

The reason you should be looking at glibc and not gcc is:

The GNU C library is used as the C library in the GNU system and most systems with the Linux kernel.

like image 96
Mark Rushakoff Avatar answered Sep 05 '25 13:09

Mark Rushakoff