리눅스에서 string 관련 함수 소스 코드가 있는 곳을 알고 싶습

jsseal의 이미지

atoi(3) 문자열을 int형 타입으로 변경
atol(3) 문자열을 long형 타입으로 변경
bzero(3) 공간을 NULL로 채운다.
perror(3) 표준에러메시지 출력
strcasecmp(3) 대소문자를 가리지않고 문자열 비교
strcat(3) 문자열 붙이기
strcmp(3)문자열 비교
strcpy(3) 문자열 복사
strdup(3)문자열 복사
strlen(3) 문자열 길이 알아내기
strncasecmp(3) 대소문자를 가리지 않고 두개의 문자열 비교
strncmp(3) 문자열 비교
strncpy(3) 문자열복사
strstr(3) 원하는 문자열이 존재하는지 검사
toupper(3) 문자를 대문자로 변경
tolower(3) 문자를 소문자로 변경

리눅스 상에서 위 함수가 구현된 소스 코드를 보려면 어케해야 하나요? 어느 디렉토리에 어떤 파일로 저장되어 있나요?

prolinko의 이미지

위의 함수들은 보통 리눅스 시스템의 경우 GNU C library를 이용합니다.
데비안의 경우 libc6, libc6-dev 레드햇의 경우 glibc, glibc-devel 같은 이름으로 패키징되어 있습니다. (dev는 개발용 패키지)

그런데 보통의 바이너리 방식의 배포판에는 패키지에 소스가 포함 되어있지 않고 미리 컴파일된 바이너리만 들어 있습니다. dev, devel같은 패키지도 인클루드를 위한 .h과 컴파일된 lib파일들만 들어있습니다. (해더파일 보실려면 보통 /usr/lib에 가셔서 "man 함수이름" 했을 때 나오는 파일이름을 찾아보시면 됩니다.)

libc 소스를 보고 싶으면 http://www.gnu.org/software/libc에 가시면 libc소스를 받으실 수 있고요,
실제로 현재 머신에서 돌아가는 라이브러리의 소스를 보려면 각 배포판의 libc 소스패키지를 받아서 살펴보셔도 됩니다. (젠투의 portage dist경로를 살펴보시거나, redhat계열의 source-rpm, 데비안의 경우 deb-src)

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.